low/high for float ranges (#11177)

This commit is contained in:
Oscar Nihlgård 2019-05-06 21:19:40 +02:00 • committed by Andreas Rumpf
commit 4c6fc173b7
4 changed files with 27 additions and 7 deletions

14
tests/misc/tlowhigh.nim Normal file
View file

@ -0,0 +1,14 @@
discard """
action: run
"""
var x: range[-1'f32..1'f32]
doAssert x.low == -1'f32
doAssert x.high == 1'f32
doAssert x.type.low == -1'f32
doAssert x.type.high == 1'f32
var y: range[-1'f64..1'f64]
doAssert y.low == -1'f64
doAssert y.high == 1'f64
doAssert y.type.low == -1'f64
doAssert y.type.high == 1'f64