Re: intdiv

new topic     » goto parent     » topic index » view thread      » older message » newer message
public function powof2(object p) 
   return not (and_bits(p, p-1)) 
end function 
 
constant MAXINT =  1073741823\\ 
constant MININT = -1073741824 
 
? powof2(MININT) => 0 

Simple error: it fails because and_bits works on
integers and MININT - 1 is not an integer.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu