mirror of
https://github.com/apple/swift-numerics
synced 2026-11-25 04:47:53 +00:00
[BigInt] Restore precondition message for inf/nan
This commit is contained in:
1 parent
ca75d2d124
commit
3501fa7c61
1 file changed
+6
-1
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user