[Openmcl-devel] BUG: FLOAT does not convert to single-float

Eric Marsden eric.marsden at free.fr
Thu Nov 17 09:25:45 PST 2011


>>>>> "kr" == Kevin Reid <kpreid at switchb.org> writes:

  ,----
  | ? (lisp-implementation-version)
  | "Version 1.8-dev  (LinuxARM32)"
  | ? (float 1.0d0)
  | 1.0D0
  `----

  kr> This is not a bug, according to my reading of the CLHS:
  kr> 
  kr> “If prototype is not supplied, then if the number is already a
  kr> float, it is returned; otherwise, a float is returned that is
  kr> mathematically equal to number but is a single float.”

You are quite right; I misread the specification. Below is a bug, though.
  
,----
| ? (defun foo (a)
|     (declare (type double-float a))
|     (float a))
| FOO
| ? (foo 1.0d0)
| 1.0
`----

-- 
Eric Marsden




More information about the Openmcl-devel mailing list