示例#1
0
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();
}
示例#2
0
Create(
    IReal value
    ///< - <tt>NonNull</tt>
    ///  - <tt>NonFractional</tt>
)
{
    NonNull.CheckParameter( value, "value" );
    NonFractional.CheckParameter( value, "value" );
    return new DecimalInteger( value.GetValue() );
}
示例#3
0
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() );
}
示例#4
0
GetHashCode(
    IReal x
)
{
    NonNull.CheckParameter( x, "x" );
    return
        typeof( IReal ).GetHashCode()
        ^ x.GetValue().GetHashCode();
}
示例#5
0
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() );
}
示例#6
0
Times(
    this IReal  dis,
    IReal       that
)
{
    NonNull.CheckParameter( dis, "dis" );
    NonNull.CheckParameter( that, "that" );
    return Create( dis.GetValue() * that.GetValue() );
}