2017-06-26 12:15:03 +03:00
|
|
|
(defmodule Double
|
2017-10-13 17:04:06 +03:00
|
|
|
(def π 3.1415926536)
|
2017-10-20 01:27:35 +03:00
|
|
|
(register < (Fn [Double Double] Bool))
|
|
|
|
(register > (Fn [Double Double] Bool))
|
2017-06-26 12:15:03 +03:00
|
|
|
(register + (Fn [Double Double] Double))
|
|
|
|
(register - (Fn [Double Double] Double))
|
|
|
|
(register * (Fn [Double Double] Double))
|
|
|
|
(register / (Fn [Double Double] Double))
|
2017-10-13 17:11:23 +03:00
|
|
|
(register to-int (Fn [Double] Int))
|
|
|
|
(register from-int (Fn [Int] Double))
|
2017-06-26 12:15:03 +03:00
|
|
|
(register sin (Fn [Double] Double))
|
|
|
|
(register cos (Fn [Double] Double))
|
2017-10-20 01:44:25 +03:00
|
|
|
(register acos (Fn [Double] Double))
|
2017-10-20 01:27:35 +03:00
|
|
|
(register atan2 (Fn [Double Double] Double))
|
|
|
|
(register sqrt (Fn [Double] Double))
|
2017-10-10 21:13:58 +03:00
|
|
|
(register str (Fn [Double] String))
|
2017-10-19 19:34:44 +03:00
|
|
|
(register copy (Fn [(Ref Double)] Double))
|
2017-10-20 01:44:25 +03:00
|
|
|
|
|
|
|
(defn clamp [min, max, val]
|
|
|
|
(if (> val max)
|
|
|
|
max
|
|
|
|
(if (< val min)
|
|
|
|
min
|
|
|
|
val)))
|
2017-06-26 12:15:03 +03:00
|
|
|
)
|