Page 1 of 1 1
Topic Options
#194721 - 2009-07-13 04:33 PM 4.60: minor problem with max integer size and modulo
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
This product of boredomness revealed a bug \:\)

in v. 4.53 evaluating 2147483648 mod 2 yields (correctly) 0
in v. 4.60 it evalutes to 1

2147483648 is btw. the max integer size (2147483646 mod 2 gave correct results in both versions)


Edited by Jochen (2009-07-13 04:34 PM)
Edit Reason: version typo
_________________________



Top
#194727 - 2009-07-13 06:30 PM Re: 4.60: minor problem with max integer size and modulo [Re: Jochen]
Benny69 Offline
Moderator
*****

Registered: 2003-10-29
Posts: 1036
Loc: Lincoln, Ne
LOL! Boredom can be a good thing once in a while, it defiantly is a nice break putting out fires, lol
_________________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)

Top
#195527 - 2009-08-22 01:47 PM Re: 4.60: minor problem with max integer size and modulo [Re: Benny69]
Ruud van Velsen Moderator Offline
Developer
*****

Registered: 1999-05-06
Posts: 391
Loc: Amsterdam, The Netherlands
Good catch... this is actually a side-effect of the slightly newer implementation of the text-to-integer runtime code (ttol()). This used to translate "2147483648" into -2147483648, and today returns 2147483647.

You can see this just by printing 2147483648:

? 2147483648 ; will display 2147483647...

Ruud

Top
Page 1 of 1 1


Moderator:  ShaneEP, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 360 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.052 seconds in which 0.023 seconds were spent on a total of 13 queries. Zlib compression enabled.