@@ -326,6 +326,9 @@ extension Decimal : SignedNumeric {
326
326
return answer;
327
327
}
328
328
329
+ @available ( * , unavailable, message: " Decimal does not yet fully adopt FloatingPoint. " )
330
+ public mutating func formTruncatingRemainder( dividingBy other: Decimal ) { fatalError ( " Decimal does not yet fully adopt FloatingPoint " ) }
331
+
329
332
public mutating func negate( ) {
330
333
guard _length != 0 else { return }
331
334
_isNegative = _isNegative == 0 ? 1 : 0
@@ -389,6 +392,7 @@ extension Decimal {
389
392
self . init ( Int64 ( value) )
390
393
}
391
394
public init ( _ value: Double ) {
395
+ precondition ( !value. isInfinite, " Decimal does not yet fully adopt FloatingPoint " )
392
396
if value. isNaN {
393
397
self = Decimal . nan
394
398
} else if value == 0.0 {
@@ -477,15 +481,25 @@ extension Decimal {
477
481
public init ( _ value: UInt ) {
478
482
self . init ( UInt64 ( value) )
479
483
}
484
+
480
485
public init ( _ value: Int ) {
481
486
self . init ( Int64 ( value) )
482
487
}
488
+
489
+ @available ( * , unavailable, message: " Decimal does not yet fully adopt FloatingPoint. " )
490
+ public static var infinity : Decimal { fatalError ( " Decimal does not yet fully adopt FloatingPoint " ) }
491
+
492
+ @available ( * , unavailable, message: " Decimal does not yet fully adopt FloatingPoint. " )
493
+ public static var signalingNaN : Decimal { fatalError ( " Decimal does not yet fully adopt FloatingPoint " ) }
494
+
483
495
public var isSignalingNaN : Bool {
484
496
return false
485
497
}
498
+
486
499
public static var nan : Decimal {
487
500
return quietNaN
488
501
}
502
+
489
503
public static var quietNaN : Decimal {
490
504
var quiet = Decimal ( )
491
505
quiet. _isNegative = 1
0 commit comments