summary refs log tree commit diff stats
path: root/tests/float/tfloat2.nim
blob: 1de63dde3dd25ea1eaa080f7e7420f8478d857ec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
discard """
  outputsub: "Error: unhandled exception: FPU operation caused a NaN result [FloatInvalidOpDefect]"
  exitcode: "1"
"""
# Test new floating point exceptions

{.floatChecks: on.}

var x = 0.0
var y = 0.0

echo x / y #OUT Error: unhandled exception: FPU operation caused a NaN result
pan>threadpool proc computeSomething(a, b: string): string = a & b & a & b & "\n" proc main = let fvA = spawn computeSomething("foo", "bar") let fvB = spawn computeSomething("baz", "bear") echo(^fvA, ^fvB) main() sync() type TIntSeq = seq[int] proc t(): TIntSeq = result = @[1] proc p(): int = var a: FlowVar[TIntSeq] parallel: var aa = spawn t() a = aa result = (^a)[0] echo p()