|
From: Raymond T. <toy...@gm...> - 2025-12-05 21:59:13
|
On 12/5/25 10:21 AM, Barton Willis via Maxima-discuss wrote: > > For subnormal floats, the SBCL CL function scale-float is possibly buggy: > > SBCL 2.4.7: > > Define Maxima function that calls the CL function scale-float > > (%i1) :lisp(defun $scale_float (x m) (scale-float x m)) > > (%i1) x : 2.0^(-1024); > (%o1) 5.562684646268004e-309 > > This is a SBCL bug, I think: surely scaling by zero should be an > identity? > > (%i2) scale_float(x,0); > (%o2) 2.7813423231340017e-308 > > (%i3) x : 2.0^(-1023); > (%o3) 1.1125369292536007e-308 This is kinda surprising. Cmucl gets this right. So does ecl. Kinda funny too; it's not obvious what's happening here. `integer-decode-float` for the scaled result is `#x14000000000000` and an exponent of -1074, instead of the expected `#x10000000000000` with exponent -1076. |