float problem
Hi ,
In one float variable I have the value as 0.02 But when I am trying to use that value it is automatically changing to 0.021999 . Because of it I am having problem. How to solve it? Please help. |
Re: float problem
Show the code.
|
Re: float problem
here you go
Code:
public cvar_results(id,const cvar[],const value[]) |
Re: float problem
And how am I supposed to know which of the four variables is in question and where you are seeing the incorrect value?
You need to explain these things, we can't read your mind. |
Re: float problem
ArrayGetString(g_sCvars,i,sBuffer,255)
This is like m_yaw 0.022 0.022 0.022 then in the variables dMin=str_to_float(sMin) dMax=str_to_float(sMax) fMiddle=str_to_float(sMiddle) I am getting like 0.219999 instead of 2.2, Because of it my checking is getting failed. |
Re: float problem
Code:
|
Re: float problem
:(
Can you tell me how to use it? Just a simple example? |
Re: float problem
that's not the deal about how you use it. you should google float point precision
|
Re: float problem
Quote:
So I don't know actually how to get exact float by parsing the string. |
Re: float problem
How much precision do you need?
|
| All times are GMT -4. The time now is 19:37. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.