diff --git a/tests/float/tfloat8.nim b/tests/float/tfloat8.nim new file mode 100644 index 0000000000000..02075bb4feeaf --- /dev/null +++ b/tests/float/tfloat8.nim @@ -0,0 +1,19 @@ +discard """ +disabled: windows +""" + +{.passL: "-lm".} # not sure how to do this on windows + +import strutils + +proc nextafter(a,b: float64): float64 {.importc: "nextafter", header: "".} + +var myFloat = 2.5 + +for i in 0 .. 100: + let newFloat = nextafter(myFloat, Inf) + let oldStr = $myFloat + let newStr = $newFloat + doAssert parseFloat(newStr) == newFloat + doAssert oldStr != newStr + myFloat = newFloat