Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Test.Tensor.TestValue
Description
Test values
Intended for unqualified import.
Synopsis
- data TestValue
Documentation
Test values
Test values are suitable for use in QuickCheck tests involving floating point numbers, if you want to ignore rounding errors.
Instances
Arbitrary TestValue Source # | Arbitrary instance The definition of shrink @TestValue 100.1 == [0,50,75,88,94,97] versus shrink @Float 100.1 == [100.0,0.0,50.0,75.0,88.0,94.0,97.0,99.0,0.0,50.1,75.1,87.6,93.9,97.0,98.6,99.4,99.8,100.0] |
Num TestValue Source # | |
Defined in Test.Tensor.TestValue | |
Fractional TestValue Source # | |
Real TestValue Source # | |
Defined in Test.Tensor.TestValue Methods toRational :: TestValue -> Rational # | |
Show TestValue Source # | Show instance We have more precision available for smaller values, so we show more
decimals. However, larger values the show instance does not reflect the
precision: show @TestValue 0 == "0" -- True zero show @TestValue 1 == "1" -- True one show @TestValue 0.001 == "0.00" show @TestValue 0.009 == "0.01" show @TestValue 1.001 == "1.0" show @TestValue 11 == "11" |
Eq TestValue Source # | Test values are equipped with a crude equality (==) -------------------- 1.0 1.1 False 1.00 1.01 True 10 11 False 10.0 10.1 True 100 110 False 100 101 True |
Ord TestValue Source # | |
Random TestValue Source # | |