mirror of
https://github.com/janet-lang/janet
synced 2025-12-02 06:48:04 +00:00
First commit removing the integer number type. This should
remove some complexity and unexpected behavior around numbers in general as all numbers are the same number type, IEEE 754 double precision numbers. Also update examples and tests, some of which were out of date. Some more testing may be needed for new changes to numbers.
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
|
||||
(assert (order< nil false true
|
||||
(fiber/new (fn [] 1))
|
||||
1 1.0 "hi"
|
||||
1.0 "hi"
|
||||
(quote hello)
|
||||
(array 1 2 3)
|
||||
(tuple 1 2 3)
|
||||
|
||||
@@ -21,8 +21,7 @@
|
||||
(import test/helper :prefix "" :exit true)
|
||||
(start-suite 1)
|
||||
|
||||
(assert (= 400.0 (math/sqrt 160000)) "sqrt(160000)=400")
|
||||
(assert (= (real 400) (math/sqrt 160000)) "sqrt(160000)=400")
|
||||
(assert (= 400 (math/sqrt 160000)) "sqrt(160000)=400")
|
||||
|
||||
(def test-struct {'def 1 'bork 2 'sam 3 'a 'b 'het @[1 2 3 4 5]})
|
||||
(assert (= (get test-struct 'def) 1) "struct get")
|
||||
@@ -188,7 +187,7 @@
|
||||
|
||||
(assert (= 14 (sum (map inc @[1 2 3 4]))) "sum map")
|
||||
(def myfun (juxt + - * /))
|
||||
(assert (= '[2 -2 2 0] (myfun 2)) "juxt")
|
||||
(assert (= '[2 -2 2 0.5] (myfun 2)) "juxt")
|
||||
|
||||
# Case statements
|
||||
(assert
|
||||
|
||||
Reference in New Issue
Block a user