[BigInt] Restore precondition message for inf/nan

This commit is contained in:
Ben Rimmington committed 2020-01-21 17:30:47 +00:00
1 parent ca75d2d124
commit 3501fa7c61
1 file changed
+6 -1
+6 -1
View File
@@ -337,7 +337,12 @@ extension BigInt: BinaryInteger {
}
public init<T>(_ source: T) where T: BinaryFloatingPoint {
precondition(source.isFinite, "BigInt(\(source)) failed")
precondition(
source.isFinite,
"""
\(type(of: source)) value cannot be converted to BigInt because it is \
either infinite or NaN
""")
precondition(T.significandBitCount < .max)
let source = source.rounded(.towardZero)