close Warning: Can't synchronize with repository "(default)" (/project/cmucl/public_html/git/cmucl.git does not appear to be a Git repository.). Look in the Trac log for more information.

Opened 11 years ago

Closed 11 years ago

#10 closed defect (fixed)

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

Reported by: rtoy 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 11 years ago by rtoy

  • Resolution set to fixed
  • Status changed from new to closed

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

Note: See TracTickets for help on using tickets.