Layer.CreateRectangle method with absolute values

Any idea how i can create a rectangle with specific absolute roundness values. Now i calculate it from the small side value in percentage. But this gives me not a usable exactly result. Because the int is from 0 to 100 value. The inaccuracy arises when converting double to int

CornerLL
Number (Int32)
Specifies the roundness measurement of the lower-left corner of the rectangle. Values range between 0 and 100.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
            double test = 0;
            if (xSize < ySize)
            {
                test = xSize / 100;
            }
            else
            {
                test = ySize / 100;
            }
            cornerRadius = (cornerRadius / test) * 2;

            corelApp.ActiveLayer.CreateRectangle(0, 0, xSize, ySize, (int)cornerRadius, (int)cornerRadius, (int)cornerRadius, (int)cornerRadius);