30
33
def fraction_float(frac):
31
35
return float(frac.num) / float(frac.denom)
33
37
def fraction_eq(frac, other):
34
39
if isinstance(other, gst.Fraction):
35
40
return frac.num * other.denom == frac.denom * other.num
38
43
def fraction_ne(frac, other):
39
45
return not fraction_eq(frac, other)
41
47
def fraction_mul(frac, other):
42
49
if isinstance(other, gst.Fraction):
43
50
return gst.Fraction(frac.num * other.num,
44
51
frac.denom * other.denom)