summary refs log tree commit diff stats
path: root/tests/rational/trat_init.nim
blob: 360a4853763078d2e191907f30401affe6e24808 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
discard """
  output: '''true'''
"""
import rationals
var
  z = Rational[int](num: 0, den: 1)
  o = initRational(num=1, den=1)
  a = initRational(1, 2)

try:
  var
    r = initRational(1, 0)  # this fails - no zero denominator
except AssertionError:
  echo "true"