diff lib/js/urweb.js @ 1571:f403e129c276

Primitive int/float functions: ceil, float, round, trunc
author Adam Chlipala <adam@chlipala.net>
date Sat, 08 Oct 2011 17:23:58 -0400
parents df6a7a22760a
children e283ca05c829
line wrap: on
line diff
--- a/lib/js/urweb.js	Sat Oct 08 14:16:13 2011 -0400
+++ b/lib/js/urweb.js	Sat Oct 08 17:23:58 2011 -0400
@@ -93,6 +93,25 @@
 }
 
 
+// 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) {