Marco Maggi a écrit :
Ciao,

in the language specs on the website:

icmp compares two integers a and b. It returns 0 if they’re
equal,
-1 if b > a, and 1 if a > b.

acmp compares the addresses of a and b. It returns 0 if they’re
the same, -1 if b>a, and 1 if a>b

of course it is "<" that evaluates to "-1"; and:

Is there something wrong here ?   b > a  ~=  a < b

bcmp returns 0 if a and b are both true or both false, 1 if a
is true and b and false, -1 if a is false and b is true.

is wrong in 1.7.1 because:

$print($compare(true,false))
$print($compare(false,true))

prints null in both cases.

Thanks for reporting, this has been fixed on CVS.

It's funny that such thing went unnoticed for so long time. I guess that bool comparisons are pretty rare.

Nicolas


--
Neko : One VM to run them all
(http://nekovm.org)

Reply via email to