qb64 long integers

by lawgin (no login)

I've noticed that when the long integer limit is exceeded, I get erroneous results rather than an overflow error as expected. The code below, for example, works fine up to 3^19. After that the results vary wildly, some negative.

DEFLNG B
FOR a = 15 TO 35
b = 3 ^ a
PRINT a, b
NEXT a

Posted on Mar 3, 2012, 1:12 PM

Respond to this message   

Return to Index


Response TitleAuthor and Date
Re: qb64 long integers on Mar 3
 Re: qb64 long integerslawgin on Mar 4
  Re: qb64 long integers on Mar 4
   Mathematically speaking, -x^y is defined as -(x^y) on Mar 4
   It is by design on Mar 6
   There is some ambiguity in the expressionlawgin on Mar 6