Why are floating point numbers inaccurate?

In most programming languages, floating point numbers are represented a lot like scientific notation: with an exponent and a mantissa (also called the significand). A very simple number, say 9.2, is actually this fraction: 5179139571476070 * 2 -49 Where the exponent is -49 and the mantissa is 5179139571476070. The reason it is impossible to represent … Read more

What’s the difference between passing by reference vs. passing by value?

First and foremost, the “pass by value vs. pass by reference” distinction as defined in the CS theory is now obsolete because the technique originally defined as “pass by reference” has since fallen out of favor and is seldom used now.1 Newer languages2 tend to use a different (but similar) pair of techniques to achieve … Read more