summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/js/urweb.js42
-rw-r--r--lib/ur/basis.urs15
2 files changed, 56 insertions, 1 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js
index 410a0e23..96a12637 100644
--- a/lib/js/urweb.js
+++ b/lib/js/urweb.js
@@ -116,6 +116,48 @@ function pow(n, m) {
return Math.pow(n, m);
}
+function sqrt(n){
+ return Math.sqrt(n);
+}
+
+function sin(n){
+ return Math.sin(n);
+}
+
+function cos(n){
+ return Math.cos(n);
+}
+
+function log(n){
+ return Math.log(n);
+}
+
+function exp(n){
+ return Math.exp(n);
+}
+
+function asin(n){
+ return Math.asin(n);
+}
+function acos(n){
+ return Math.acos(n);
+}
+
+function atan(n){
+ return Math.atan(n);
+}
+
+function atan2(n, m){
+ return Math.atan2(n, m);
+}
+
+function floor(n){
+ return Math.floor(n);
+}
+
+function abs(n){
+ return Math.abs(n);
+}
// Time, represented as counts of microseconds since the epoch
diff --git a/lib/ur/basis.urs b/lib/ur/basis.urs
index 883cc5b1..1163daed 100644
--- a/lib/ur/basis.urs
+++ b/lib/ur/basis.urs
@@ -152,7 +152,20 @@ val float : int -> float
val ceil : float -> int
val trunc : float -> int
val round : float -> int
-
+val floor : float -> int
+
+(** * Basic Math *)
+
+val sqrt : float -> float
+val sin : float -> float
+val cos : float -> float
+val log : float -> float
+val exp : float -> float
+val asin : float -> float
+val acos : float -> float
+val atan : float -> float
+val atan2 : float -> float -> float
+val abs: float -> float
(** * Time *)