This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 29240 - Clarify whether NaN is allowed in float/double types
Summary: Clarify whether NaN is allowed in float/double types
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: WebIDL (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Cameron McCormack
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-26 07:14 UTC by Geoffrey Sneddon
Modified: 2017-07-30 12:58 UTC (History)
3 users (show)

See Also:


Attachments

Description Geoffrey Sneddon 2015-10-26 07:14:53 UTC
Float is "set of finite single-precision 32 bit IEEE 754 floating point numbers", unrestricted float is "set of all possible single-precision 32 bit IEEE 754 floating point numbers, finite and non-finite".

It seems obvious that NaN is not a float: it's not in the set of finite numbers. It also would appear that NaN is not a unrestricted float as it isn't a number. However, elsewhere in the spec we see the constant NaN exists as a unrestricted float.

We should clarify this (and also for the similar double case). There's also the question of whether the set contains 2^24-2 representations of NaN or a single representation of NaN (like the Number type in ES).
Comment 1 Tobie Langel 2017-07-28 13:59:01 UTC
Tentative fix: https://github.com/heycam/webidl/pull/393
Comment 2 Tobie Langel 2017-07-30 12:58:58 UTC
Fixed in https://github.com/heycam/webidl/commit/44d0f24