Skip to content

Commit

Permalink
Fix of strict
Browse files Browse the repository at this point in the history
  • Loading branch information
XeroXP committed Jun 23, 2022
1 parent 57c2705 commit 60bc90a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions BigSharp/Big.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,20 +109,35 @@ 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);
}

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

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

0 comments on commit 60bc90a

Please sign in to comment.