[Gambas-user] what's wrong with this long integer?
Benoît Minisini
gambas at ...1...
Sun Aug 2 01:00:59 CEST 2009
> I have a failure with a long integer:
>
>
> DIM IntMyNumber AS Long
>
> IntMyNumber = 90 * 89 * 88 * 87 * 86 * 85
> PRINT IntMyNumber
>
> returns 1605934816
>
> --------------------------------------------
> Bash returns the correct value:
>
> echo $[90*89*88*87*86*85]
>
> 448282533600 (that is less than 9.223.372.036.854.775.807)
>
> So why Gambas fails even if I declared it as Long?
>
> Gambas 2.15.1
>
> Saluti,
>
> Stefano
>
Because only the destination variable is declared as Long. You must do that:
IntMyNumber = CLong(90) * 89 * 88 * 87 * 86 * 85
--
Benoît
More information about the User
mailing list