Alejandro Forero Cuervo scripsit: > In Chicken 3.4.0 linux-unix-gnu-x86-64 the expression (abs 2147483648) > evaluates to -2147483648 in both csi and a compiled program (negative? > and positive?, however, seem to work correctly).
The bug is still present in 4.1.1, and it's drastic: #;1> (abs 2147483648) -2147483648 #;2> (abs 2147483649) 2147483647 #;3> (abs 2147483650) 2147483646 #;4> (abs 4294967296) 0 > It evaluated correctly in a 32-bits build of the same version. It works in 32-bit Chicken because 2147483648 (like every integer greater than 1073741823) is a flonum. > In the meantime, I'll put the following in my programs. Other people > may want to do the same: > > (when (negative? (abs 2147483648)) > (set! abs > (lambda (x) > (if (negative? x) > (- x) > x)))) I'd just override the definition of abs to begin with. -- John Cowan co...@ccil.org http://www.ccil.org/~cowan Any day you get all five woodpeckers is a good day. --Elliotte Rusty Harold _______________________________________________ Chicken-users mailing list Chicken-users@nongnu.org http://lists.nongnu.org/mailman/listinfo/chicken-users