I need to test if a double is an integer or not. Basically this is an example of the rule:
- 5.0 > true
- 5.2 > false
In order to do this I'd make an if (result mod 1) = 0 then
and see the if it returns true or false. Consider that result
is a double. By the way the compiler gives me this error:
[dcc32 Error] Unit1.pas(121): E2015 Operator not applicable to this operand type
How can I solve this problem? Note that my numbers are in this format ##.#####
so I haven't many problems with the floating point precision.
In general I'd use if (result % 1 == 0) {}
but in Delphi this does not work.