close Warning: Can't synchronize with repository "(default)" ("(default)" is not readable or not a Git repository.). Look in the Trac log for more information.

Opened 17 years ago

Closed 17 years ago

#10 closed defect (fixed)

round is sometimes wrong for numbers bigger than most-positive-fixnum

Reported by: Raymond Toy Owned by: somebody
Priority: minor Milestone:
Component: Core Version: 19d
Keywords: round Cc:

Description

(round (+ 536870911 1.5d0)) should return 536870912 and 0.5d0. However, cmucl returns 536870913 and -0.5d0.

The code in float.lisp for %unary-round appears to be wrong for numbers outside fixnum range. At the very least we should extend the range to (signed-byte 32), but there would still be issues for other numbers.

Change History (1)

comment:1 Changed 17 years ago by Raymond Toy

Resolution: fixed
Status: newclosed

Fixed. Was not checking for odd-valued results that needed to be rounded to even.

Note: See TracTickets for help on using tickets.