Skip to content

Instantly share code, notes, and snippets.

@ghalimi
Created January 13, 2013 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ghalimi/4524836 to your computer and use it in GitHub Desktop.
Save ghalimi/4524836 to your computer and use it in GitHub Desktop.
ERF Function
// Copyright (c) 2012 Sutoiku, Inc. (MIT License)
function ERF(lower_bound, upper_bound) {
// Set number2 to zero if undefined
upper_bound = (typeof upper_bound === 'undefined') ? 0 : upper_bound;
// Return error if either number is not a number
if (isNaN(lower_bound) || isNaN(upper_bound)) return '#VALUE!';
// Return ERFC using jStat [http://www.jstat.org/]
return jStat.erf(lower_bound);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment