%f and division by 4096
Hi guys! why %f gives me 0.000000 when i'm dividing some numbers?
code
example of output
|
Re: %f and division by 4096
Because dataA and dataB are integer variables and not declared as float.
|
Re: %f and division by 4096
Quote:
how can i convert integer to float |
Re: %f and division by 4096
|
Re: %f and division by 4096
new Float:fValue
read_data(arg_num, fValue) |
Re: %f and division by 4096
Or if you are really reading integers then read them just as you do now and convert only when you do the division.
|
Re: %f and division by 4096
And use 4096.0 instead of 4096: fValue / 4096.0. While not required, it's cleaner IMO.
|
Re: %f and division by 4096
Thank you all very much!
|
| All times are GMT -4. The time now is 02:35. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.