Commit a0fa9ad1 authored by Mart Lubbers's avatar Mart Lubbers

Numerical limits

parent 7cf5bad6
definition module Data.Int
from StdInt import IF_INT_64_OR_32
LargestInt :== IF_INT_64_OR_32 9223372036854775807 2147483647
SmallestInt :== IF_INT_64_OR_32 -9223372036854775808 -2147483648
implementation module Data.Int
definition module Data.Real
from System._Architecture import IF_INTEL
from StdInt import IF_INT_64_OR_32
// Compile-time check whether the x86 extended precision format is used for
// intermediate values
IF_INTERMEDIATE_80BIT_REAL_PRECISION yes no :== IF_INTEL (IF_INT_64_OR_32 no yes) no
LargestReal :== 1.7976931348623157E+308
/**
* Smallest normalized 64 bit real > 0.0
*/
LowestReal :== 2.2250738585072014E-308
Epsilon :== 2.220446049250313E-16
Epsilon80 :== 1.08420217248550443E-19
approximatelyEqual :: !Real !Real -> Bool
implementation module Data.Real
import StdEnv
approximatelyEqual :: !Real !Real -> Bool
approximatelyEqual a b = abs (a - b) <= abs (if (abs a < abs b) a b) * Epsilon
definition module System._Architecture
IF_INTEL intel other :== other
IF_ARM arm other :== arm
implementation module System._Architecture
definition module System._Architecture
IF_INTEL intel other :== intel
IF_ARM arm other :== other
implementation module System._Architecture
...@@ -112,6 +112,7 @@ import qualified Data.IntMap.Base ...@@ -112,6 +112,7 @@ import qualified Data.IntMap.Base
import qualified Data.IntMap.Strict import qualified Data.IntMap.Strict
import qualified Data.IntSet import qualified Data.IntSet
import qualified Data.IntSet.Base import qualified Data.IntSet.Base
import qualified Data.Int
import qualified Data.Integer import qualified Data.Integer
import qualified Data.Integer.Add import qualified Data.Integer.Add
import qualified Data.Integer.Div import qualified Data.Integer.Div
...@@ -132,6 +133,7 @@ import qualified Data.Monoid ...@@ -132,6 +133,7 @@ import qualified Data.Monoid
import qualified Data.NGramIndex import qualified Data.NGramIndex
import qualified Data.OrdList import qualified Data.OrdList
import qualified Data.Queue import qualified Data.Queue
import qualified Data.Real
import qualified Data.Set import qualified Data.Set
import qualified Data.Set.GenJSON import qualified Data.Set.GenJSON
import qualified Data.Set.Gast import qualified Data.Set.Gast
...@@ -184,6 +186,7 @@ import qualified System.Socket ...@@ -184,6 +186,7 @@ import qualified System.Socket
import qualified System.Socket.Ipv4 import qualified System.Socket.Ipv4
import qualified System.Socket.Ipv6 import qualified System.Socket.Ipv6
import qualified System.Socket.Unix import qualified System.Socket.Unix
import qualified System._Architecture
import qualified System._Signal import qualified System._Signal
import qualified System._Socket import qualified System._Socket
import qualified System._Directory import qualified System._Directory
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment