Problem with Float in checking its figures
Hello, i have this code (i can't post it all for some reason's) :
Code:
new Float:WallStatus[33][3]what i missing?? please help :cry::cry::cry: |
Re: Problem with Float in checking its figures
"=" is for assigning a value.
"==" is for comparing/checking. So using "=" with "if" is not what you would do here. |
Re: Problem with Float in checking its figures
Quote:
PHP Code:
A case where this is useful(read as "works as you want") is: PHP Code:
|
Re: Problem with Float in checking its figures
Also note that a floating point value can never exactly represent a value of 1.0. Since you're using the variable as a boolean value, define it as a boolean tag.
Code:
new bool:WallStatus[33][3] |
Re: Problem with Float in checking its figures
Thanks you all guys, i will do what fysiks says.
However, using it as Float in my code would be much easier |
Re: Problem with Float in checking its figures
Quote:
|
Re: Problem with Float in checking its figures
7 Attachment(s)
Hope this saves you some effort.
Sorry I can't post the main sma here(either attached or as code). For some reason, the forum sees it as some kind of potential attack and blocks it. https://pastebin.com/8vHufWEX |
Re: Problem with Float in checking its figures
it really depends on how smart the compiler is, for AMXX its stupid, if(a = 5) since its in a if statement it should be comparing and since pawn in amxx doesnt support data types there are no reason for double equal chars for comparing....
also beside pawn uses only unsign data type......... |
Re: Problem with Float in checking its figures
Quote:
|
Re: Problem with Float in checking its figures
Quote:
Also, when used as integers (e.g. untagged variables) are signed integers. How else are you going to get -1? I never seen a mechanism to force them to be unsigned (granted, I've never search for it either). |
| All times are GMT -4. The time now is 02:46. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.