Skip to content

Instantly share code, notes, and snippets.

@arturaugusto
Created September 22, 2015 19:51
Show Gist options
  • Select an option

  • Save arturaugusto/1f5a3531f4030dc7f8e8 to your computer and use it in GitHub Desktop.

Select an option

Save arturaugusto/1f5a3531f4030dc7f8e8 to your computer and use it in GitHub Desktop.
Numerical tolerance associated with a numerical value on javascript
// JCGM_101_2008
// Numerical tolerance associated with a numerical value on javascript
// page 31
//Example 1
a=0.00035;n=2;parseFloat("1e"+(a/(Math.pow(10,n-1))).toExponential().split("e")[1])/2
//Example 2
a=0.0004;n=1;parseFloat("1e"+(a/(Math.pow(10,n-1))).toExponential().split("e")[1])/2
//Example 3
a=2;n=1;parseFloat("1e"+(a/(Math.pow(10,n-1))).toExponential().split("e")[1])/2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment