Advertisement

determining fractional component

Started by December 30, 2002 01:56 PM
1 comment, last by yckx 21 years, 10 months ago
Is there an easy way to get the fractional component of a float? Basically, I''m adding and subbing a set amt from a float, and I need to determine when the variable is a mathematical integer. Thanks yckx
Try to cast it to an int.
This should throw the fractional part away.
Now subtract this from your float.
There it is.

Hope this works!

The Wild Wild West - Desperado!
The Wild Wild West - Desperado!
Advertisement
Ahh~! Thanks.

Why is it that I understand all the complex theory stuff, yet get hung up on these simple things ; P

yckx

This topic is closed to new replies.

Advertisement