tlowhigh.nim 536 B

123456789101112131415161718192021222324252627282930313233
  1. discard """
  2. action: run
  3. output: '''
  4. 18446744073709551615
  5. 9223372036854775807
  6. 4294967295
  7. 0
  8. 0
  9. '''
  10. """
  11. var x: range[-1'f32..1'f32]
  12. doAssert x.low == -1'f32
  13. doAssert x.high == 1'f32
  14. doAssert x.type.low == -1'f32
  15. doAssert x.type.high == 1'f32
  16. var y: range[-1'f64..1'f64]
  17. doAssert y.low == -1'f64
  18. doAssert y.high == 1'f64
  19. doAssert y.type.low == -1'f64
  20. doAssert y.type.high == 1'f64
  21. # bug #11972
  22. var num: uint8
  23. doAssert num.high.float == 255.0
  24. echo high(uint64)
  25. echo high(int64)
  26. echo high(uint32)
  27. echo low(uint64)
  28. echo low(uint32)