Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Divide two integers and get a float
Message
General information
Forum:
Borland C++ Builder
Category:
Standard C++ Library
Miscellaneous
Thread ID:
01003810
Message ID:
01003843
Views:
15
Herman,
Close but no cigar <s>. Well atleast it got me thinking in the right direction. The following code works, I have to type cast both ints:
float fRes = ((float) iOne) / ((float) iTwo);
Thank you very much for the help.

Sincerely,
Einar
>
>
>Hi Einar,
>
>I never use Borland C++. But what I know is (maybe) it's because of type casting. So try the following:
>
>float fRes = (FLOAT) iOne / iTwo;
>
>Hope it works
Semper ubi sub ubi.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform