aboutsummaryrefslogtreecommitdiff
path: root/test/nums.tm
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-03-03 16:44:45 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-03-03 16:44:45 -0500
commitc5f315e338adb09bcfc4c192ccefedfaf88202fe (patch)
tree2bbabc5d7d079cb0496522592d97cb75deee50bb /test/nums.tm
parent74c86176cb2bc68f7a3c7b9c65d93184c8b7d959 (diff)
Num methods
Diffstat (limited to 'test/nums.tm')
-rw-r--r--test/nums.tm32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/nums.tm b/test/nums.tm
new file mode 100644
index 00000000..c5b19325
--- /dev/null
+++ b/test/nums.tm
@@ -0,0 +1,32 @@
+>> n := 1.5
+= 1.5
+
+>> n + n
+= 3
+
+>> n * 2
+= 3
+
+>> n - n
+= 0
+
+>> Num.PI
+= 3.14159
+
+>> Num.PI:format(precision=10)
+= "3.1415926536"
+
+>> Num.random()
+
+>> Num.INF
+= inf
+>> Num.INF:isinf()
+= yes
+
+>> Num.nan()
+= nan
+>> nan := Num.nan()
+>> nan:isnan()
+= yes
+>> nan == nan
+= no