Created
October 6, 2012 05:41
-
-
Save sasaki-shigeo/3844088 to your computer and use it in GitHub Desktop.
Numeric Constants and Convert Functions in Scheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; | |
;;; 無限大と NaN | |
;;; | |
(define negative-infinity (log 0.0)) | |
(define positive-infinity (- negative-infinity)) | |
(define NaN (+ positive-infinity negative-infinity)) | |
;;; | |
;;; 数値の変換 | |
;;; | |
(floor -3.6) ; => -4.0 繰り下げ | |
(ceil -3.6) ; => -3.0 繰り上げ | |
(truncate -3.6) ; => -3.0 切り捨て | |
(round -3.6) ; => -4.0 偶数丸め | |
(real-part 3+4i) ; => 3 実部 | |
(imag-part 3+4i) ; => 4 虚部 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment