diff options
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/system.nim | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/system.nim b/lib/system.nim index 174d739cd..4dbc0a93d 100755 --- a/lib/system.nim +++ b/lib/system.nim @@ -219,6 +219,26 @@ type object of ESynch ## is raised if an object is converted to an incompatible ## object type. + EFloatingPoint* = object of ESynch ## base class for floating point exceptions + EFloatInvalidOp* {.compilerproc.} = + object of EFloatingPoint ## Invalid operation according to IEEE: Raised by + ## 0.0/0.0, sqrt(-1.0), and log(-37.8) for example. + EFloatDivByZero* {.compilerproc.} = + object of EFloatingPoint ## Division by zero. Divisor is zero and dividend + ## is a finite nonzero number + EFloatOverflow* {.compilerproc.} = + object of EFloatingPoint ## Overflow. Operation produces a result + ## that exceeds the range of the exponent + EFloatUnderflow* {.compilerproc.} = + object of EFloatingPoint ## Underflow. Operation produces a result + ## that is too small to be represented as + ## a normal number + EFloatInexact* {.compilerproc.} = + object of EFloatingPoint ## Inexact. Operation produces a result that cannot + ## be represented with infinite precision -- + ## for example, 2.0 / 3.0, log(1.1) + ## NOTE: Nimrod currently does not detect these! + TResult* = enum Failure, Success proc sizeof*[T](x: T): natural {.magic: "SizeOf", noSideEffect.} |