git.iko.soy/rowtype-yoga/purescript-native
on 24fdff2 help sign in
rowtype-yoga/purescript-native/examples/passing/OperatorAssociativity.purs
25 lines 687 B history raw
1module Main where
3import Prelude
4import Control.Monad.Eff
5import Control.Monad.Eff.Console
6import Test.Assert
8bug :: Number -> Number -> Number
9bug a b = 0.0 - (a - b)
11main = do
12 assert (bug 0.0 2.0 == 2.0)
13 assert (0.0 - (0.0 - 2.0) == 2.0)
14 assert (0.0 - (0.0 + 2.0) == -2.0)
15 assert (6.0 / (3.0 * 2.0) == 1.0)
16 assert ((6.0 / 3.0) * 2.0 == 4.0)
17 assert (not (1.0 < 0.0) == true)
18 assert (not ((negate 1.0) < 0.0) == false)
19 assert (negate (1.0 + 10.0) == -11.0)
20 assert (2.0 * 3.0 / 4.0 == 1.5)
21 assert (1.0 * 2.0 * 3.0 * 4.0 * 5.0 / 6.0 == 20.0)
22 assert (1.0 + 10.0 - 5.0 == 6.0)
23 assert (1.0 + 10.0 * 5.0 == 51.0)
24 assert (10.0 * 5.0 - 1.0 == 49.0)
25 log "Success!"