diff options
author | Karen Sargsyan <karsar@ibms.sinica.edu.tw> | 2016-05-23 17:40:19 +0800 |
---|---|---|
committer | Karen Sargsyan <karsar@ibms.sinica.edu.tw> | 2016-05-23 17:40:19 +0800 |
commit | ae4778d7a3f4dacde39232b503bd134ce71444ee (patch) | |
tree | 7c7b838d73689bd6180ba532accde984c7e2d420 /lib | |
parent | 87a6ab4f9ac7b2b2c0438a724bfe971ec9231714 (diff) |
abs and floor added
Diffstat (limited to 'lib')
-rw-r--r-- | lib/js/urweb.js | 8 | ||||
-rw-r--r-- | lib/ur/basis.urs | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js index 55925df5..96a12637 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -151,6 +151,14 @@ 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 var time_format = "%c"; diff --git a/lib/ur/basis.urs b/lib/ur/basis.urs index c1ee28b3..1163daed 100644 --- a/lib/ur/basis.urs +++ b/lib/ur/basis.urs @@ -152,6 +152,7 @@ val float : int -> float val ceil : float -> int val trunc : float -> int val round : float -> int +val floor : float -> int (** * Basic Math *) @@ -164,6 +165,7 @@ val asin : float -> float val acos : float -> float val atan : float -> float val atan2 : float -> float -> float +val abs: float -> float (** * Time *) |