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);