Skip to content

Float type does not follow IEEE 754 standard #27653

@drewtownchi

Description

@drewtownchi

Elasticsearch version 6.0.0

Plugins installed: [x-pack]

JVM version (java -version): 1.8.0_60

OS version (uname -a if on a Unix-like system): Centos 7

Description of the problem including expected versus actual behavior:

https://www.elastic.co/guide/en/elasticsearch/reference/6.0/number.html
float | A single-precision 32-bit IEEE 754 floating point.

https://en.wikipedia.org/wiki/IEEE_754 "As with IEEE 754-1985, the biased-exponent field is filled with all 1 bits to indicate either infinity (trailing significand field = 0) or a NaN (trailing significand field ≠ 0)."

Elasticsearch is rejecting our infinity value floats. The Elasticsearch documentation claims to follow the IEEE 754 float spec but is rejecting infinity and NaN values.

Steps to reproduce:

  1. This is the commit that changed this behavior d8ff6e9
  2. Create an index
  3. Send a finite float to a field on the index
  4. Send an infinity value to the same field on the index

Provide logs (if relevant):
"caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"[float] supports only finite values, but got [Infinity]"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    >docsGeneral docs changes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions