From 3501fa7c61033ffd56ff3804580ed67aea58ca43 Mon Sep 17 00:00:00 2001 From: Ben Rimmington Date: Tue, 21 Jan 2020 17:30:47 +0000 Subject: [PATCH] [BigInt] Restore precondition message for inf/nan --- Sources/BigInt/BigInt.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Sources/BigInt/BigInt.swift b/Sources/BigInt/BigInt.swift index a8b9b8a..618ab4e 100644 --- a/Sources/BigInt/BigInt.swift +++ b/Sources/BigInt/BigInt.swift @@ -337,7 +337,12 @@ extension BigInt: BinaryInteger { } public init(_ 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)