Description
Floating number (Float and Double) provide a special, out of band value - NaN, Not-a-Number.
This occurs typically when dividing a number by zero; integer numbers don't have one and instead thrown an error.
To make things consistent, I propose we treat and convert NaN internally to null so it never reaches the user.
Several arguments to support this:
- JSON doesn't allow NaN (nor -Inf or +Inf for that matter)
- ES doesn't allow ingestion of non-finite double or float (regardless of whether JSON is used or not) - see NumberFieldMapper for floats and doubles.
Description
Floating number (Float and Double) provide a special, out of band value - NaN, Not-a-Number.
This occurs typically when dividing a number by zero; integer numbers don't have one and instead thrown an error.
To make things consistent, I propose we treat and convert NaN internally to null so it never reaches the user.
Several arguments to support this: