@@ -31,12 +31,12 @@ extension Decimal {
3131
3232 public var significand : Decimal {
3333 get {
34- return Decimal ( _exponent: 1 , _length: _length, _isNegative: _isNegative, _isCompact: _isCompact, _reserved: 0 , _mantissa: _mantissa)
34+ return Decimal ( _exponent: 0 , _length: _length, _isNegative: _isNegative, _isCompact: _isCompact, _reserved: 0 , _mantissa: _mantissa)
3535 }
3636 }
3737
3838 public init ( sign: FloatingPointSign , exponent: Int , significand: Decimal ) {
39- self . init ( _exponent: Int32 ( exponent) , _length: significand. _length, _isNegative: sign == . plus ? 1 : 0 , _isCompact: significand. _isCompact, _reserved: 0 , _mantissa: significand. _mantissa)
39+ self . init ( _exponent: Int32 ( exponent) + significand . _exponent , _length: significand. _length, _isNegative: sign == . plus ? 0 : 1 , _isCompact: significand. _isCompact, _reserved: 0 , _mantissa: significand. _mantissa)
4040 }
4141
4242 public init ( signOf: Decimal , magnitudeOf magnitude: Decimal ) {
@@ -50,7 +50,8 @@ extension Decimal {
5050 public static var radix : Int { return 10 }
5151
5252 public var ulp : Decimal {
53- return Decimal ( _exponent: 1 , _length: _length, _isNegative: _isNegative, _isCompact: _isCompact, _reserved: 0 , _mantissa: _mantissa)
53+ if !self . isFinite { return Decimal . nan }
54+ return Decimal ( _exponent: _exponent, _length: 8 , _isNegative: 0 , _isCompact: 1 , _reserved: 0 , _mantissa: ( 0x0001 , 0x0000 , 0x0000 , 0x0000 , 0x0000 , 0x0000 , 0x0000 , 0x0000 ) )
5455 }
5556
5657 @available ( * , unavailable, message: " Decimal does not yet fully adopt FloatingPoint. " )
0 commit comments