diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:06:40 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:06:40 -0800 |
commit | a69c9fb665459e2bfdbda1bf80741a0af31a7faf (patch) | |
tree | f0bc974f8805049e6b9a4e6864886298fbaa05a4 /bytenumb.scm | |
parent | 4684239efa63dc1b2c1cbe37ef7d3062029f5532 (diff) | |
download | slib-upstream.tar.gz slib-upstream.zip |
New upstream version 3b5upstream/3b5upstream
Diffstat (limited to 'bytenumb.scm')
-rwxr-xr-x[-rw-r--r--] | bytenumb.scm | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/bytenumb.scm b/bytenumb.scm index 053a433..4af40b6 100644..100755 --- a/bytenumb.scm +++ b/bytenumb.scm @@ -174,6 +174,7 @@ ;;(bytes->ieee-double (bytes 0 4 0 0 0 0 0 0)) @result{} 5.562684646268003e-309 ;;(bytes->ieee-double (bytes 0 0 0 0 0 0 0 1)) @result{} 4.0e-324 ;; +;;(bytes->ieee-double (list->bytes '(127 239 255 255 255 255 255 255))) 179.76931348623157e306 ;;(bytes->ieee-double (bytes #xFF #xF0 0 0 0 0 0 0)) @result{} -inf.0 ;;(bytes->ieee-double (bytes #x7F #xF0 0 0 0 0 0 0)) @result{} +inf.0 ;;(bytes->ieee-double (bytes #x7F #xF8 0 0 0 0 0 0)) @result{} 0/0 @@ -183,8 +184,7 @@ ;;Returns a 4-element byte-array encoding the IEEE single-precision ;;floating-point of @1. (define ieee-float->bytes - (let ((zero (or (string->number "0.0") 0)) - (exactify (if (provided? 'inexact) inexact->exact identity))) + (let ((exactify (if (provided? 'inexact) inexact->exact identity))) (lambda (flt) (define byts (make-bytes 4 0)) (define S (and (real? flt) (negative? (if (zero? flt) (/ flt) flt)))) @@ -241,8 +241,7 @@ ;;Returns a 8-element byte-array encoding the IEEE double-precision ;;floating-point of @1. (define ieee-double->bytes - (let ((zero (or (string->number "0.0") 0)) - (exactify (if (provided? 'inexact) inexact->exact identity))) + (let ((exactify (if (provided? 'inexact) inexact->exact identity))) (lambda (flt) (define byts (make-bytes 8 0)) (define S (and (real? flt) (negative? (if (zero? flt) (/ flt) flt)))) |