Opened 5 years ago

Closed 5 years ago

#364 closed defect (fixed)

truncate, floor, ceiling round should return a non-finite argument

Reported by: cowan Owned by: cowan
Priority: major Milestone:
Component: WG1 - Core Keywords:
Cc:

Description (last modified by cowan)

Currently R7RS is silent on what truncate, floor, ceiling, and round do when the argument is +inf.0, -inf.0, or +nan.0. R6RS has them return the argument, which seems reasonable.

I tested (round (* 1.0e200 1.0e200)) on my usual suite of Schemes. Racket, Gauche, Chicken (with and without the numbers egg), Bigloo, Guile, Kawa, Chibi, Chez, SCM, Ikarus/Vicare?, Larceny, Ypsilon, Mosh, IronScheme, !NexJ, STklos, KSi, Shoe, BDC, Rep, Schemik, Elk, Spark all return the argument.

MIT, Gambit, Scheme48/scsh, SISC, Scheme 9, Scheme 7, signal errors.

SigScheme, TinyScheme, Dream, UMB don't work for one or another reason.

Oaklisp and Owl Lisp don't do flonums.

XLisp only has fixnums and flonums, and returns the largest or smallest fixnum as the case may be.

RScheme returns a variety of slightly strange values: (round +inf.0), for example, is 0, but (round -inf.0) is -inf.0.

Change History (4)

comment:1 Changed 5 years ago by cowan

  • Description modified (diff)

comment:2 Changed 5 years ago by cowan

  • Status changed from new to decided

WG1 decided that these functions return these arguments unchanged.

comment:3 Changed 5 years ago by cowan

  • Owner changed from alexshinn to cowan
  • Status changed from decided to writing

comment:4 Changed 5 years ago by cowan

  • Resolution set to fixed
  • Status changed from writing to closed
Note: See TracTickets for help on using tickets.