reinstate mask-field; correct argtype of phase - gcl.git - GNU Common Lisp

index : gcl.git
GNU Common Lisp
summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamm Maguire <camm@debian.org>2013年11月15日 19:21:08 +0000
committerCamm Maguire <camm@debian.org>2013年11月15日 19:21:08 +0000
commit6a3d9609be562b81ef4c23f80321b8ec1a0c4d57 (patch)
tree66d06a2f0dedbf0a0fab440587262cbd14c5d7c7
parentc3044d43f9ab2919cb7d4e3bc663989b10830d44 (diff)
downloadgcl-6a3d9609be562b81ef4c23f80321b8ec1a0c4d57.tar.gz
reinstate mask-field; correct argtype of phase
Diffstat
-rwxr-xr-xgcl/lsp/gcl_numlib.lsp 10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcl/lsp/gcl_numlib.lsp b/gcl/lsp/gcl_numlib.lsp
index 31a3ce617..5bf1fd536 100755
--- a/gcl/lsp/gcl_numlib.lsp
+++ b/gcl/lsp/gcl_numlib.lsp
@@ -99,12 +99,18 @@
(check-type integer integer)
(logior (logandc2 integer z) (logand newbyte z)))
+(defun mask-field (bytespec integer)
+ (declare (optmize (safety 1)))
+ (check-type bytespec bytespec)
+ (check-type integer integer)
+ (logand integer (ash (1- (ash 1 (byte-size bytespec))) (byte-position bytespec))))
+
(defun phase (x)
(declare (optimize (safety 1)))
- (check-type x complex)
+ (check-type x number)
(if (= 0 x) 0.0
- (atan (imagpart x) (realpart x))))
+ (atan (imagpart x) (realpart x))))
(defun signum (x)
(declare (optimize (safety 1)))
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月05日 05:21:15 +0000

AltStyle によって変換されたページ (->オリジナル) /