From 8b909d991fe993c711d432cfc9928dc7ffbdbbac Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sat, 8 Oct 2011 17:23:58 -0400 Subject: Primitive int/float functions: ceil, float, round, trunc --- lib/js/urweb.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'lib/js') 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) { -- cgit v1.2.3