f12af9890ed85b3b7a3158b6dfaa452132c9c6d4
[clnl] / src / main / strictmath / base.lisp
1 (in-package #:strictmath)
2
3 (defun to-radians (deg)
4  "TO-RADIANS DEG => RAD
5
6 ARGUMENTS AND VALUES:
7
8   DEG: A double representing the angle in degrees
9   RAD: A double representing the angle in radians
10
11 DESCRIPTION:
12
13   TO-RADIANS returns the radians equivalent of the angle passed in, in
14   degrees."
15  (* (/ deg 180d0) pi))
16
17 ;(defun sin (rad)
18 ; (cl:sin rad))
19 (defun decode-float64 (x)
20  (let
21   ((i (ieee-floats:encode-float64 x)))
22   (values
23    (ash i -32)
24    (logand (ieee-floats:encode-float64 1.5707963267341256d0) #x00000000ffffffff))))
25
26 (defun encode-float64 (y1 y2)
27  (ieee-floats:decode-float64 (+ (ash y1 32) y2)))
28
29 (defun float64-abs (x)
30  (abs x))