[Gambas-user] DIV

Benoît Minisini gambas at ...1...
Thu Jul 12 18:55:17 CEST 2012


Le 12/07/2012 18:52, Jussi Lahtinen a écrit :
>> This is for performance reasons: '\' (or DIV) operator is faster than '/'.
>>
>
> OK.
>
>
>
>> If you want to use DIV like '/', just use '/'!
>>
>
> "/" is different thing, it doesn't give integer quotient.
> To get integer quotient from floats I use "iQuotient = Floor( a / b )".
>
>
> Jussi

CInt(a / b) is faster.

And if iQuotient is already an integer, just doing iQuotient = a / b is 
a little bit faster again.

Regards,

-- 
Benoît Minisini






More information about the User mailing list