Bad error message in RANDOM when ARG is not positive

Bug #598985 reported by Maciej Katafiasz
This bug report is a duplicate of:  Bug #598986: RANDOM error message. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
New
Undecided
Unassigned

Bug Description

CL-USER> (let ((min 4.1)
               (max 4.1))
           (+ min
              (random (+ (- max min)
                         (if (floatp max) 0 1)))))

The value 0.0
is not of type
  (OR (SINGLE-FLOAT (0.0)) (DOUBLE-FLOAT (0.0d0)) (INTEGER 1)).
   [Condition of type TYPE-ERROR]

This is a very bad way to say "ARG must be positive".

<stassats> random has a better error message but it's not reached because of the type definition

I'm not quite sure what the best way to fix it in this case is, so no patch.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.