Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
82 lines (70 sloc) 1.57 KB
(ns unicode-math.core
(require [clojure.set :as set]))
(def ½ 1/2)
(def ¼ 1/4)
(def ¾ 3/4)
(def1/3)
(def2/3)
(def1/5)
(def2/5)
(def3/5)
(def4/5)
(def1/6)
(def5/6)
(def1/8)
(def3/8)
(def5/8)
(def7/8)
(def ⌈ #(Math/ceil %))
(def ⌊ #(Math/floor %))
(def | #(Math/abs %))
(def<=)
(def>=)
(defnot=)
(defn
([x y ε]
( (| (- x y)) ε))
([x y]
( x y 1e-9)))
;; Please don't use these
(def-)
(def ÷ /)
(def ∕ /)
(def × *)
(def ⁿ #(Math/pow %1 %2))
(def ¹ identity)
(def ² #( % 2))
(def ³ #( % 3))
(def √ #(Math/sqrt %))
(def ∛ #( % ⅓))
(def ∜ #( % ¼))
(def π Math/PI)
(def φ (/ (+ 1 ( 5)) 2))
(def e Math/E)
(defDouble/POSITIVE_INFINITY)
(def Π (partial apply *))
(def Σ (partial apply +))
(def ‰ #(/ 1000))
(def ‱ #(/ 10000))
(def ¬ not)
(defmacro ∧ [& xs] `(and ~@xs))
(defmacro ∨ [& xs] `(or ~@xs))
(defmacro ⊽ [& xs] `(¬ ( ~@xs)))
(defmacro ⊼ [& xs] `(¬ ( ~@xs)))
(defmacro ∀ [binding & exprs]
`(every? identity (for ~binding ~@exprs)))
(defmacro ∃ [binding & exprs]
`(if (some identity (for ~binding ~@exprs)) true false))()
(defmacro ∄ [binding & exprs]
`(if (some identity (for ~binding ~@exprs)) false true))
(defset/intersection)
(defset/union)
(defcontains?)
(defn ∈ [element coll] (contains? coll element))
(def ∉ (complement ∈))
(def ∌ (complement ∋))
(defset/difference)
(defset/subset?)
(defset/superset?)
(def ⊄ (complement ⊂))
(def ⊅ (complement ⊃))