Top "Precision" questions

For questions related to numerical precision in programming.

How can I test floating-point equality using chai?

We're using Chai's BDD API to write unit tests. How can we assert floating point equality? For example, if I …

javascript floating-point precision chai
Setting minimum number of decimal places for std::ostream precision

Is there a way to set the "minimum" number of decimal places that a std::ostream will output? For example, …

c++ decimal precision ostream
calculating a function in matlab with very small values

I am making a function in matlab to compute the following function: for this function we have: This is my …

matlab precision exponential epsilon
Representing integers in doubles

Can a double (of a given number of bytes, with a reasonable mantissa/exponent balance) always fully precisely hold the …

c math floating-point precision ieee-754
Point in Polygon algorithm giving wrong results sometimes

I saw on StackOverflow a "point in polygon" raytracing algorithm that I implemented in my PHP Code. Most of the …

php polygon pip precision point