#define val 1.05 is actually 1.049999 ?
So basically I have this:
Code:
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:
This presents the output: Code:
Why is 1.05 represented as 1.049999 ? And how do I get it to be 1.05? Thanks, Josh |
Re: #define val 1.05 is actually 1.049999 ?
floats are not very excact, some floats doesnt exist.
???,here the explain:floats on computer are based on hex. 1.05 are in hex :3F866666,but 3F866666 are also 1.049999952,so some floats doenst exist or exist twice. This problem is based on the mathematic of floats. To get 1.05 you must use 1.051 , 1.052 |
| All times are GMT -4. The time now is 20:17. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.