StevenLooman / magik-tools

Sonar Magik plugin
GNU General Public License v3.0
18 stars 10 forks source link

use-value-compare errors when using radix number #113

Closed StevenLooman closed 1 week ago

StevenLooman commented 2 weeks ago

use-value-compare errors when using radix number

sebastiaanspeck commented 2 weeks ago

Does it error when using 16e2/16e+2/16e-2/2&3/-10/-1.0/36rz as well?

StevenLooman commented 2 weeks ago

Actually, it appears that bignum starts at 1 << 31:

Magik> (1.shift(31) - 1).class_name
:integer 
Magik> 1.shift(31).class_name
:bignum 

Though I'm unsure about SW4. Do you have access to SW4, @sebastiaanspeck ?

sebastiaanspeck commented 2 weeks ago

Actually, it appears that bignum starts at 1 << 31:


Magik> (1.shift(31) - 1).class_name

:integer 

Magik> 1.shift(31).class_name

:bignum 

Though I'm unsure about SW4. Do you have access to SW4, @sebastiaanspeck ?

I do,

MagikSF> (1.shift(31) - 1).class_name
$
:bignum 
MagikSF> 1.shift(31).class_name
$
:bignum 
StevenLooman commented 2 weeks ago

Thanks! The number that was present in the check (1 <<29 or 536870912) is the first value of a bignum.