Skip to content

Commit

Permalink
fix culture errors on erf function constants
Browse files Browse the repository at this point in the history
  • Loading branch information
daelsepara committed Oct 18, 2018
1 parent 8abee29 commit 7aa8ac5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions PhaseExplorer/Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,18 +156,18 @@ unsafe public static void Copy(Pixbuf dst, byte* src)
}
}

public static CultureInfo ci = new CultureInfo("en-US");
public static CultureInfo ci = new CultureInfo("en-US");

// see: https://www.johndcook.com/blog/csharp_erf/
public static double Erf(double x)
{
// constants
double a1 = Convert.ToDouble("0.254829592", ci);
double a2 = Convert.ToDouble("-0.284496736", ci);
double a3 = Convert.ToDouble("1.421413741", ci);
double a4 = Convert.ToDouble("-1.453152027", ci);
double a5 = Convert.ToDouble("1.061405429", ci);
double p = Convert.ToDouble("0.3275911", ci);
double a1 = Convert.ToDouble("0.254829592", ci);
double a2 = Convert.ToDouble("-0.284496736", ci);
double a3 = Convert.ToDouble("1.421413741", ci);
double a4 = Convert.ToDouble("-1.453152027", ci);
double a5 = Convert.ToDouble("1.061405429", ci);
double p = Convert.ToDouble("0.3275911", ci);

// Save the sign of x
int sign = 1;
Expand Down

0 comments on commit 7aa8ac5

Please sign in to comment.