[Gambas-user] about IsFloat and IsInteger behaviour...

Benoit Minisini gambas at ...1...
Sat May 13 20:18:46 CEST 2006


On Thursday 11 May 2006 15:45, Stefano Palmeri wrote:
> Hi all.
>
> It's a lot of time from my mathematics studies at school, so excuse the
> stupid question...
>
> Please, could someone explain to me this Gambas behaviour?
>
> ------------------------------
> PRINT IsFloat (Int(4 / 2))
> --> True ?
>
> PRINT IsFloat(2)
> --> False
> ------------------------------
>
> ------------------------------
> PRINT IsInteger(3.5)
> --> False
>
> PRINT IsInteger(Int(3.5))
> --> False ?
> ------------------------------
>
> Thanks in advance for any answer.
>
> Regards,
>
> Stefano Palmeri
>
> Gambas 1.0.14
> Gambas 1.9.28
>

Because Int() is implemented as always returning a floating point number. The 
IsXXX() functions test the Gambas datatype of an expression, not its real 
type in the real life!

Regards,

-- 
Benoit Minisini





More information about the User mailing list