Skip to content

Commit

Permalink
Clarify that Float does not include NaN or infinity
Browse files Browse the repository at this point in the history
Fixes #778.

This matches the fact that you cannot represent these values in text as
FloatValue, as well as the graphql-js
implementation (https://github.com/graphql/graphql-js/blob/16009cbcb0109da03f2157a868817b886801095a/src/type/scalars.js#L108-L112).

This was perhaps already implied by the word "fractional", but "finite" seems to
be a more standard term for "IEEE 754 floats that are not infinity or NaN".
  • Loading branch information
glasser committed Sep 16, 2020
1 parent d3ea511 commit acf270e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions spec/Section 3 -- Type System.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,10 +450,11 @@ encoding integer numbers larger than 32-bit.

### Float

The Float scalar type represents signed double-precision fractional values
as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).
Response formats that support an appropriate double-precision number type
should use that type to represent this scalar.
The Float scalar type represents signed double-precision finite (i.e., not {NaN}
or infinity) fractional values as specified by [IEEE
754](https://en.wikipedia.org/wiki/IEEE_floating_point). Response formats that
support an appropriate double-precision number type should use that type to
represent this scalar.

**Result Coercion**

Expand Down

0 comments on commit acf270e

Please sign in to comment.