Summary
abs() argument truncated on 64-bit
Metadata
- Id: 116bb980adddb6c331512b81fdf4f0061bc39937
- Trac id: 62
- Type: defect
- Reporter: zbigniew
- Owner:
- Cc:
- Status: closed
- Component: core libraries
- Estimated difficulty:
- Resolution: fixed
- Priority: major
- Milestone:
- Version:
- Changetime: 2009-07-31 22:03:12 UTC
- Created: 2009-07-31 20:24:49 UTC
- Keywords:
Attachments
- 116bb980adddb6c331512b81fdf4f0061bc39937/attachments/abs-64bit.diff.txt
Description
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
Changes and comments
[2009-07-31 20:25:04 UTC] zbigniew attached abs-64bit.diff.txt (description=#f)
[2009-07-31 20:27:46 UTC] zbigniew removed version 4.0.x
[2009-07-31 20:27:46 UTC] zbigniew wrote:
Clarification, removed ticket version number, it applies to all versions.
[2009-07-31 22:03:12 UTC] felix changed status from new to closed
[2009-07-31 22:03:12 UTC] felix set resolution to fixed
[2009-07-31 22:03:12 UTC] felix wrote:
Patch attached in r15291. Thanks.