diff options
author | Adam Chlipala <adam@chlipala.net> | 2011-10-08 17:23:58 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2011-10-08 17:23:58 -0400 |
commit | ff119b6f75734c94df9f86cda58e95e1b6506705 (patch) | |
tree | af5545a16e8c2d7f65737c161285cf78b8ed2d43 /lib/js/urweb.js | |
parent | 47ed9101fdb70e576c6cfbebce06ca78b6d7b973 (diff) |
Primitive int/float functions: ceil, float, round, trunc
Diffstat (limited to 'lib/js/urweb.js')
-rw-r--r-- | lib/js/urweb.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/js/urweb.js b/lib/js/urweb.js index d7149eba..1cfbf0ca 100644 --- a/lib/js/urweb.js +++ b/lib/js/urweb.js @@ -93,6 +93,25 @@ function length(ls) { } +// Floats + +function float(n) { + return n; +} + +function trunc(n) { + return ~~n; +} + +function ceil(n) { + return Math.ceil(n); +} + +function round(n) { + return Math.round(n); +} + + // Time function showTime(tm) { |