From: Taylor R Campbell Date: Sat, 27 Oct 2018 02:21:06 +0000 (+0000) Subject: Export primitive flonum-denormalize as flo:ldexp and flo:scalbn. X-Git-Tag: mit-scheme-pucked-10.1.2~16^2~143 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=b1e6736c1f33a6735b3e4de93a9b98734f52d59b;p=mit-scheme.git Export primitive flonum-denormalize as flo:ldexp and flo:scalbn. These are the familiar -- and when FLT_RADIX = 2, equivalent -- names for the operation in libm. `Denormalize' is not right: neither does it turn a normal number into a subnormal, nor does it put anything into a canonical interval like [1/2, 1) or [1, 2). I personally favour `shift' -- it is, in Z, the same as the bitwise shift operation. But unless anyone else wants to join me against this windmill I'll just stay with the familiar if ugly libm names. --- diff --git a/src/runtime/primitive-arithmetic.scm b/src/runtime/primitive-arithmetic.scm index 62729665c..aa00cf993 100644 --- a/src/runtime/primitive-arithmetic.scm +++ b/src/runtime/primitive-arithmetic.scm @@ -200,6 +200,7 @@ USA. (flo:cbrt flonum-cbrt 1) (flo:hypot flonum-hypot 2) (flo:expt flonum-expt 2) + (flo:denormalize flonum-denormalize 2) (flo:lgamma flonum-lgamma 1) (flo:gamma flonum-gamma 1) (flo:erf flonum-erf 1) diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index 3a05dd288..0ca3cd3d8 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -243,6 +243,8 @@ USA. (smallest-fixnum fix:smallest-value)) (export () (exact-integer? int:integer?) + (flo:ldexp flo:denormalize) + (flo:scalbn flo:denormalize) ->flonum exact-integer-sqrt fix:*