예제 #1
0
파일: Decimal64.cs 프로젝트: noop-dev/DFP
 public static Decimal64 FromFixedPoint(long mantissa, int numberOfDigits)
 {
     // TODO: More optimizations
     return(new Decimal64(
                0 == (mantissa & (-1L << 53))
                         ? DotNetImpl.FromFixedPointLimitedU64((UInt64)mantissa, numberOfDigits)
                         : NativeImpl.fromFixedPoint64(mantissa, numberOfDigits)));
 }
예제 #2
0
파일: Decimal64.cs 프로젝트: noop-dev/DFP
 /// <summary>
 /// Returns canonical representation of Decimal.
 /// We consider that all binary representations of one arithmetic value have the same canonical binary representation.
 /// Canonical representation of zeros = <see cref="Zero"/>>
 /// Canonical representation of NaNs = <see cref="NaN"/>
 /// Canonical representation of PositiveInfinities = <see cref="PositiveInfinity"/>
 /// Canonical representation of NegativeInfinities = <see cref="NegativeInfinity"/>
 /// </summary>
 /// <returns>Canonical representation of decimal argument.</returns>
 public Decimal64 Canonize()
 {
     if (IsNaN())
     {
         return(NaN);
     }
     if (IsInfinity())
     {
         if (IsPositiveInfinity())
         {
             return(PositiveInfinity);
         }
         else
         {
             return(NegativeInfinity);
         }
     }
     return(new Decimal64(DotNetImpl.Canonize(this.Bits)));
 }
예제 #3
0
파일: Decimal64.cs 프로젝트: noop-dev/DFP
 public static Decimal64 FromFixedPoint(uint mantissa, int numberOfDigits)
 {
     return(new Decimal64(DotNetImpl.FromFixedPoint32(mantissa, numberOfDigits)));
 }
예제 #4
0
파일: Decimal64.cs 프로젝트: noop-dev/DFP
 public Decimal64 Abs()
 {
     return(new Decimal64(DotNetImpl.Abs(Bits)));
 }
예제 #5
0
파일: Decimal64.cs 프로젝트: noop-dev/DFP
 public static Decimal64 operator -(Decimal64 value)
 {
     return(new Decimal64(DotNetImpl.Negate(value.Bits)));
 }
예제 #6
0
파일: Decimal64.cs 프로젝트: noop-dev/DFP
 public Decimal64 Negate()
 {
     return(new Decimal64(DotNetImpl.Negate(Bits)));
 }
예제 #7
0
파일: Decimal64.cs 프로젝트: noop-dev/DFP
 public override String ToString()
 {
     return(DotNetImpl.ToString(Bits));
     //return ((Double)this).ToString(CultureInfo.InvariantCulture);
 }
예제 #8
0
파일: Decimal64.cs 프로젝트: noop-dev/DFP
 public Boolean IsZero()
 {
     return(DotNetImpl.IsZero(Bits));
 }
예제 #9
0
파일: Decimal64.cs 프로젝트: noop-dev/DFP
 public static Decimal64 FromDecimalDouble(Double value)
 {
     return(new Decimal64(DotNetImpl.FromDecimalFloat64(value)));
 }
예제 #10
0
파일: Decimal64.cs 프로젝트: noop-dev/DFP
 public Boolean IsSigned()
 {
     return(DotNetImpl.SignBit(Bits));
 }
예제 #11
0
파일: Decimal64.cs 프로젝트: noop-dev/DFP
 public Boolean IsNegativeInfinity()
 {
     return(DotNetImpl.IsNegativeInfinity(Bits));
 }
예제 #12
0
파일: Decimal64.cs 프로젝트: noop-dev/DFP
 public Boolean IsNaN()
 {
     return(DotNetImpl.IsNaN(Bits));
 }
예제 #13
0
파일: Decimal64.cs 프로젝트: noop-dev/DFP
 public Boolean IsNull()
 {
     return(DotNetImpl.IsNull(Bits));
 }
예제 #14
0
파일: Decimal64.cs 프로젝트: noop-dev/DFP
 public Decimal ToDecimal()
 {
     return(DotNetImpl.ToDecimal(ToUnderlying()));
 }
예제 #15
0
파일: Decimal64.cs 프로젝트: noop-dev/DFP
 public static Decimal64 FromDecimal(Decimal value)
 {
     return(new Decimal64(DotNetImpl.FromDecimal(value)));
 }
예제 #16
0
파일: Decimal64.cs 프로젝트: noop-dev/DFP
 public Boolean IsFinite()
 {
     return(DotNetImpl.IsFinite(Bits));
 }
예제 #17
0
파일: Decimal64.cs 프로젝트: noop-dev/DFP
 public static Decimal64 FromUInt(uint value)
 {
     return(new Decimal64(DotNetImpl.FromUInt32(value)));
 }