diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-04-12 13:09:31 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-04-12 13:09:31 -0400 |
| commit | 6c01eef851439549018267fdc439e4884af0c624 (patch) | |
| tree | 0599dd071b8a5effb67e6a87ed1c34777eb8d8c7 /test/nums.tm | |
| parent | 17cb6ffd88c4464c513b045f4b06c4e6e46e8f22 (diff) | |
Introducing the main() function
Diffstat (limited to 'test/nums.tm')
| -rw-r--r-- | test/nums.tm | 73 |
1 files changed, 37 insertions, 36 deletions
diff --git a/test/nums.tm b/test/nums.tm index 14926aa0..766cfb48 100644 --- a/test/nums.tm +++ b/test/nums.tm @@ -1,49 +1,50 @@ ->> n := 1.5 -= 1.5 +func main() + >> n := 1.5 + = 1.5 ->> n + n -= 3 + >> n + n + = 3 ->> n * 2 -= 3 + >> n * 2 + = 3 ->> n - n -= 0 + >> n - n + = 0 ->> Num.PI -= 3.14159 + >> Num.PI + = 3.14159 ->> Num.PI:format(precision=10) -= "3.1415926536" + >> Num.PI:format(precision=10) + = "3.1415926536" ->> Num.random() + >> Num.random() ->> Num.INF -= inf ->> Num.INF:isinf() -= yes + >> Num.INF + = inf + >> Num.INF:isinf() + = yes ->> Num.nan() -= nan ->> nan := Num.nan() ->> nan:isnan() -= yes ->> nan == nan -= no + >> Num.nan() + = nan + >> nan := Num.nan() + >> nan:isnan() + = yes + >> nan == nan + = no ->> Num.PI:cos():near(-1) -= yes ->> Num.PI:sin():near(0) -= yes + >> Num.PI:cos():near(-1) + = yes + >> Num.PI:sin():near(0) + = yes ->> 10.0:pow(3) -= 1000 + >> 10.0:pow(3) + = 1000 ->> Num.nan():near(Num.nan()) -= no + >> Num.nan():near(Num.nan()) + = no ->> Num.INF:near(-Num.INF) -= no + >> Num.INF:near(-Num.INF) + = no ->> Num32.sqrt(16f32) -= 4_f32 + >> Num32.sqrt(16f32) + = 4_f32 |
