fix partially broken link
Source Link
Anton
  • 185
  • 11

Binary floating point math is like this. In most programming languages, it is based on the IEEE 754 standardIEEE 754 standard. The crux of the problem is that numbers are represented in this format as a whole number times a power of two; rational numbers (such as 0.1, which is 1/10) whose denominator is not a power of two cannot be exactly represented.

Binary floating point math is like this. In most programming languages, it is based on the IEEE 754 standard. The crux of the problem is that numbers are represented in this format as a whole number times a power of two; rational numbers (such as 0.1, which is 1/10) whose denominator is not a power of two cannot be exactly represented.

Binary floating point math is like this. In most programming languages, it is based on the IEEE 754 standard. The crux of the problem is that numbers are represented in this format as a whole number times a power of two; rational numbers (such as 0.1, which is 1/10) whose denominator is not a power of two cannot be exactly represented.

Rollback to Revision 22
Source Link
S.S. Anne
  • 14.4k
  • 7
  • 35
  • 67

Instead do if (fabsabs(x - y) < myToleranceValue) { ... }.

Instead do if (fabs(x - y) < myToleranceValue) { ... }.

Instead do if (abs(x - y) < myToleranceValue) { ... }.

fabs is for floating-point numbers
Source Link
S.S. Anne
  • 14.4k
  • 7
  • 35
  • 67

Instead do if (absfabs(x - y) < myToleranceValue) { ... }.

Instead do if (abs(x - y) < myToleranceValue) { ... }.

Instead do if (fabs(x - y) < myToleranceValue) { ... }.

remove language-specific bits, make formatting for links consistent
Source Link
Acorn
  • 23.4k
  • 4
  • 35
  • 66
Loading
Active reading [<https://en.wikipedia.org/wiki/JavaScript>].
Source Link
Peter Mortensen
  • 29.8k
  • 21
  • 98
  • 124
Loading
Stackoverflow is not for self-promotion on external links and hijacking answers. Create a new answer.
Source Link
MauriceNino
  • 5.7k
  • 1
  • 17
  • 48
Loading
deleted 1 character in body
Source Link
Blorgbeard
  • 96.6k
  • 45
  • 222
  • 266
Loading
Updated bad advice I gave on Number.EPSILON and offer a warning NOT to use it, with a link to a more detailed look at why
Source Link
Daniel Scott
  • 1.5k
  • 15
  • 13
Loading
Added summary to address the inevitable question of "well then, why don't we represent numbers with a system of ____?" + two core usage tips for floating point numbers in programming
Source Link
Daniel Scott
  • 1.5k
  • 15
  • 13
Loading
Added summary to address the inevitable question of "well then, why don't we represent numbers with a system of ____?"
Source Link
Daniel Scott
  • 1.5k
  • 15
  • 13
Loading
Major edit; explain the problem and remove the "you should never..." admonition.
Source Link
tmyklebu
  • 13.4k
  • 3
  • 27
  • 53
Loading
fixed link to the appropriate wikipedia article on float epsilon
Source Link
khelwood
  • 51.4k
  • 13
  • 70
  • 93
Loading
Formatting and some minor updates.
Source Link
Amal Murali
  • 72.7k
  • 18
  • 123
  • 143
Loading
added 106 characters in body
Source Link
deceze
  • 488.1k
  • 78
  • 699
  • 844
Loading
sinful.js's math operations are naively implemented and do not provide the semantics they claim.
Source Link
Loading
added 140 characters in body; Post Made Community Wiki
Source Link
SheetJS
  • 21.2k
  • 12
  • 62
  • 75
Loading
made link more descriptive
Source Link
Joshua Taylor
  • 82.5k
  • 9
  • 146
  • 322
Loading
There are many IEEE standards, specify which standard and add links.
Source Link
andrewdotn
  • 29.5k
  • 7
  • 90
  • 121
Loading
There are many IEEE standards, specify which standard and add links.
Source Link
Loading
Removed Machine epsilon link because commenters say it's not helpful
Source Link
Patrick McElhaney
  • 55.1k
  • 39
  • 126
  • 164
Loading
Added information Gary Willoughby's comment: changed "some constant" to "Epsilon value" and linked to definition.
Source Link
Patrick McElhaney
  • 55.1k
  • 39
  • 126
  • 164
Loading
added 11 characters in body
Source Link
Brian R. Bondy
  • 325.1k
  • 117
  • 583
  • 622
Loading
added 191 characters in body
Source Link
Brian R. Bondy
  • 325.1k
  • 117
  • 583
  • 622
Loading
Source Link
Brian R. Bondy
  • 325.1k
  • 117
  • 583
  • 622
Loading