cl-protobufÀïÓÐ(utilities.lisp)£º
628 #+(or abcl allegro ccl cmu sbcl lispworks)
629 (defun make-double-float (low high)
630 (declare (type (unsigned-byte 32) low)
631 (type (signed-byte 32) high))
632 #+abcl (system:make-double-float (logior (ash high 32) low))
633 #+allegro (excl:shorts-to-double-float (ldb (byte 16 16) high)
634 (ldb (byte 16 0) high)
635 (ldb (byte 16 16) low)
636 (ldb (byte 16 0) low))
637 #+ccl (ccl::double-float-from-bits (ilogand high #xffffffff) low)
638 #+cmu (kernel:make-double-float high low)
639 #+sbcl (sb-kernel:make-double-float high low)
640 #+lispworks (lispworks-float:make-double-float high low))
641
642 #-(or abcl allegro ccl cmu sbcl lispworks)
643 (defun make-double-float (low high)
644 (declare (type (unsigned-byte 32) low)
645 (type (signed-byte 32) high))
646 (cond
647 ;; IEEE float special cases
648 ((and (zerop high) (zerop low)) 0.0d0)
649 ((and (= high #x-80000000)
650 (zerop low)) -0.0d0)
651 (t
652 (let* ((bits (logior (ash high 32) low))
653 (sign (ecase (ldb (byte 1 63) bits)
654 (0 1.0d0)
655 (1 -1.0d0)))
656 (iexpt (ldb (byte 11 52) bits))
657 (exponent (if (zerop iexpt) ;denormalized
658 -1022
659 (- iexpt 1023)))
660 (mantissa (* (logior (ldb (byte 52 0) bits)
661 (if (zerop iexpt) 0 (ash 1 52)))
662 (expt 0.5d0 52))))
663 (* sign (expt 2.0d0 exponent) mantissa)))))
Post by savior michael¿Žµœ cl-olefsÖÐʹÓÃÁËÒ»žö CCL::DOUBLE-FLOAT-FROM-BITS
ÎÒʹÓõÄÊÇsbcl ÏëÐŽÒ»žöÍšÓõĿÉÒÆÖ²µÄ°æ±Ÿ£¬Çóˌ·
--
--
Lisp-cn(LispÖÐÎÄÓû§×é)
CLUG http://lisp.org.cn
---
ÄúÊÕµœŽËÓÊŒþÊÇÒòΪÄú¶©ÔÄÁË Google ÍøÉÏÂÛ̳µÄ¡°Lisp-cn(LispÖÐÎÄÓû§×é)¡±ÂÛ̳¡£
Òª²é¿Žžü¶àÑ¡ÏÇë·ÃÎÊ https://groups.google.com/groups/opt_out¡£
--
--
Lisp-cn(LispÖÐÎÄÓû§×é)
CLUG http://lisp.org.cn
---
ÄúÊÕµœŽËÓÊŒþÊÇÒòΪÄú¶©ÔÄÁË Google ÍøÉÏÂÛ̳µÄ¡°Lisp-cn(LispÖÐÎÄÓû§×é)¡±ÂÛ̳¡£
ÒªÍ˶©ŽËÂÛ̳²¢Í£Ö¹œÓÊÕŽËÂÛ̳µÄµç×ÓÓÊŒþ£¬Çë·¢Ë͵ç×ÓÓÊŒþµœ lisp-cn+unsubscribe-/***@public.gmane.org¡£
Òª²é¿Žžü¶àÑ¡ÏÇë·ÃÎÊ https://groups.google.com/groups/opt_out¡£