Author Topic: Small glitch with negative int value  (Read 1172 times)

0 Members and 1 Guest are viewing this topic.

Brian Alvarez

  • Guest
Small glitch with negative int value
« on: November 24, 2018, 09:04:11 PM »
I suspect str is casting the object function into a dword, when it is really an int...

Code: [Select]
class glitchy
  int glt[10]
  method constructor()
     glt[5] = -5
  end method
  function func(int d) as int
    print "i am returning: " & str(glt[d])
    return glt[d]
  end function 
end class

new glitchy sss()

print "but i am receiving: " & str(sss.func(5))

int f = sss.func(5)

print "no, it is correct: " & str(f)

output:

Code: [Select]
i am returning: -5

but i am receiving: 4294967291

no, it is correct: -5

Charles Pegge

  • Guest
Re: Small glitch with negative int value
« Reply #1 on: November 25, 2018, 09:37:28 AM »
Brian,
This works correctly on the new o2. Only -5 is seen.

Brian Alvarez

  • Guest
Re: Small glitch with negative int value
« Reply #2 on: November 25, 2018, 10:11:09 AM »
Awesome Charles, I will download it now.

 Thanks!

Brian Alvarez

  • Guest
Re: Small glitch with negative int value
« Reply #3 on: November 25, 2018, 11:01:01 AM »

I can confirm it works fine in this release. :)