floatcmp()
Description
Compare two floating point numbers.
Syntax
floatcmp(oper1, oper2);
Parameters
Variable | Input |
|---|---|
| First floating point number to compare. |
| Second floating point number to compare. |
Returns
Return value | Return explanation |
|---|---|
-1 | if oper1 < oper2 |
1 | if oper1 > oper2 |
0 | if oper1 is equal to oper2. |
Function call example
Example of comparing two strings
new Float:data1 = 10;
new Float:data2 = 20;
new Float:cmp;
main()
{
cmp = floatcmp(data1, data2); //result will be cmp = -1 since data1 is less than data2
while(1)
{
Delay(100);
}
}