From 60bc90ad0e0f0230966e5ae1cdd20b70d9f416e8 Mon Sep 17 00:00:00 2001 From: XeroXP Date: Thu, 23 Jun 2022 18:13:28 +0500 Subject: [PATCH] Fix of strict --- BigSharp/Big.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/BigSharp/Big.cs b/BigSharp/Big.cs index dffe78b..15b17be 100644 --- a/BigSharp/Big.cs +++ b/BigSharp/Big.cs @@ -109,6 +109,11 @@ public Big(int n) } public Big(long n) { + if (Big.STRICT == true) + { + throw new BigException(INVALID + "value"); + } + var nString = n == 0 && 1 / (double)n < 0 ? "-0" : n.ToString(CultureInfo.InvariantCulture); parse(this, nString); @@ -116,6 +121,11 @@ public Big(long n) public Big(double n) { + if (Big.STRICT == true) + { + throw new BigException(INVALID + "value"); + } + var nString = n == 0 && 1 / n < 0 ? "-0" : n.ToString(CultureInfo.InvariantCulture); parse(this, nString); @@ -123,6 +133,11 @@ public Big(double n) public Big(decimal n) { + if (Big.STRICT == true) + { + throw new BigException(INVALID + "value"); + } + var nString = n == 0 && 1 / n < 0 ? "-0" : n.ToString(CultureInfo.InvariantCulture); parse(this, nString);