Float number calculations
For example i have:
PHP Code:
Code:
fStart: 80.000000 |
Re: Float number calculations
Dunno if it is the way it is printed, or if it is due to float precision, anyway, internal value should be ok.
|
Re: Float number calculations
Yeah .. the printed is same, floats are strange in amxx, and i need to use floats.
|
Re: Float number calculations
I have made a similar test
Code:
new Float:a = 32.0; Code:
32.130001 |
Re: Float number calculations
This is how float works in pawn or in c++, so what i said that should be ok internally seems wrong.
You can read those interesting thread : https://forums.alliedmods.net/showthread.php?t=53543 https://forums.alliedmods.net/showthread.php?t=53535 https://forums.alliedmods.net/showthread.php?t=47051 Anyway, in your case, multiply all by 10 and you can works with integers. And if you want to print as Float, you can trick it like this : PHP Code:
|
Re: Float number calculations
somehow, sometimes the floats act this way...
Nothing wrong with you code and there is nothing ( i think ) you can do. Also they work in c++ same way. |
Re: Float number calculations
Thank you again Connor :wink:.
|
All times are GMT -4. The time now is 06:05. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.