So basically I have this:
Code:
#define ITEM_BOOT_INCREASE 1.05 // Represents % increase
And I do a little math later:
( ( ITEM_BOOT_INCREASE - 1.00 ) * 100.00 )
Which (in theory) is 5.
But when doing client_prints and checking the results:
Code:
client_print( id, print_chat, "(%f - %f) * %f = %0.0f", ITEM_BOOT_INCREASE, 1.00, 100.00, ( ( ITEM_BOOT_INCREASE - 1.00 ) * 100.00 ) );
This presents the output:
Code:
(1.049999 - 1.000000) * 100.000000 = 4
Why is 1.05 represented as 1.049999 ? And how do I get it to be 1.05?
Thanks,
Josh
__________________