Opened 15 years ago

Closed 15 years ago

#62 closed defect (fixed)

abs() argument truncated on 64-bit

Reported by: Jim Ursetto Owned by:
Priority: major Milestone:
Component: core libraries Version:
Keywords: Cc:
Estimated difficulty:


Reported by Alejandro:

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). It evaluated
correctly in a 32-bits build of the same version.

Using labs() instead of abs() should fix the issue

Attachments (1)

abs-64bit.diff.txt (458 bytes) - added by Jim Ursetto 15 years ago.

Download all attachments as: .zip

Change History (3)

Changed 15 years ago by Jim Ursetto

Attachment: abs-64bit.diff.txt added

comment:1 Changed 15 years ago by Jim Ursetto

Version: 4.0.x

Clarification, removed ticket version number, it applies to all versions.

comment:2 Changed 15 years ago by felix winkelmann

Resolution: fixed
Status: newclosed

Patch attached in r15291. Thanks.

Note: See TracTickets for help on using tickets.