Equals( IReal x, IReal y ) { if( x == null && y == null ) return true; if( x == null || y == null ) return false; if( object.ReferenceEquals( x, y ) ) return true; return x.GetValue() == y.GetValue(); }
Create( IReal value ///< - <tt>NonNull</tt> /// - <tt>NonFractional</tt> ) { NonNull.CheckParameter( value, "value" ); NonFractional.CheckParameter( value, "value" ); return new DecimalInteger( value.GetValue() ); }
Compare( IReal x, IReal y ) { if( x == null && y == null ) return 0; if( x == null ) return -1; if( y == null ) return 1; if( object.ReferenceEquals( x, y ) ) return 0; return x.GetValue().CompareTo( y.GetValue() ); }
GetHashCode( IReal x ) { NonNull.CheckParameter( x, "x" ); return typeof( IReal ).GetHashCode() ^ x.GetValue().GetHashCode(); }
DividedBy( this IReal dis, IReal that ///< - <tt>NonZero</tt> ) { NonNull.CheckParameter( dis, "dis" ); NonNull.CheckParameter( that, "that" ); NonZero.CheckParameter( that, "that" ); return Create( dis.GetValue() / that.GetValue() ); }
Times( this IReal dis, IReal that ) { NonNull.CheckParameter( dis, "dis" ); NonNull.CheckParameter( that, "that" ); return Create( dis.GetValue() * that.GetValue() ); }