Sha256: 6ab2fbbd69b2c29ef36fcc27a13d10e77816f8089b2079b99b4eb33143c81260
Contents?: true
Size: 941 Bytes
Versions: 4
Compression:
Stored size: 941 Bytes
Contents
module Dydx module Algebra module Operator module Parts module General def +(x) if x.is_0? self else super(x) end end def -(x) if x.is_0? self else super(x) end end def *(x) if x.is_0? x elsif x.is_1? self else super(x) end end def /(x) if x.is_0? raise ZeroDivisionError elsif x.is_1? self else super(x) end end def ^(x) if x.is_0? _(1) elsif x.is_1? self else super(x) end end end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems