From 5145dd3aa0c02c9fc496d1432fc4410674206e1d Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 20 Feb 2017 00:05:31 -0800 Subject: Import Upstream version 3a2 --- bytenumb.txi | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'bytenumb.txi') diff --git a/bytenumb.txi b/bytenumb.txi index 67c340b..9be7630 100644 --- a/bytenumb.txi +++ b/bytenumb.txi @@ -28,6 +28,7 @@ bytes are treated as two's-complement (can be negative). @end example @end defun + @defun integer->bytes n len Converts the integer @var{n} to a byte-array of @code{(abs @var{n})} @@ -44,11 +45,13 @@ returned array are coded two's-complement. @end example @end defun + @defun bytes->ieee-float bytes @var{bytes} must be a 4-element byte-array. @code{bytes->ieee-float} calculates and returns the value of @var{bytes} interpreted as a big-endian IEEE 4-byte (32-bit) number. @end defun + @example (bytes->ieee-float (bytes #x40 0 0 0)) @result{} 2.0 (bytes->ieee-float (bytes #x40 #xd0 0 0)) @result{} 6.5 @@ -69,6 +72,7 @@ value of @var{bytes} interpreted as a big-endian IEEE 4-byte (32-bit) number. @var{bytes} must be a 8-element byte-array. @code{bytes->ieee-double} calculates and returns the value of @var{bytes} interpreted as a big-endian IEEE 8-byte (64-bit) number. @end defun + @example (bytes->ieee-double (bytes 0 0 0 0 0 0 0 0)) @result{} 0.0 (bytes->ieee-double (bytes #x40 0 0 0 0 0 0 0)) @result{} 2 @@ -90,6 +94,7 @@ value of @var{bytes} interpreted as a big-endian IEEE 8-byte (64-bit) number. Returns a 4-element byte-array encoding the IEEE single-precision floating-point of @var{x}. @end defun + @example (bytes->list (ieee-float->bytes 2.0)) @result{} (64 0 0 0) (bytes->list (ieee-float->bytes 6.5)) @result{} (64 208 0 0) @@ -110,6 +115,7 @@ floating-point of @var{x}. Returns a 8-element byte-array encoding the IEEE double-precision floating-point of @var{x}. @end defun + @example (bytes->list (ieee-double->bytes 2.0)) @result{} (64 0 0 0 0 0 0 0) (bytes->list (ieee-double->bytes 6.5)) @result{} (64 26 0 0 0 0 0 0) @@ -149,6 +155,7 @@ two's-complement byte-vectors matches numerical order. @code{integer-byte-colla @var{byte-vector} and is its own functional inverse. @end deffn + @defun integer-byte-collate byte-vector Returns copy of @var{byte-vector} with sign bit modified so that @code{string