Home

sNaN

sNaN, short for signaling NaN, is a type of NaN defined in the IEEE 754 floating-point standard. It is distinguished from a quiet NaN (qNaN) by a signaling bit in the NaN’s significand. When a floating-point value is NaN, the exponent is all ones and the significand is nonzero; the signaling bit determines whether the NaN is meant to signal an invalid operation (sNaN) or simply propagate as a quiet result (qNaN). In binary formats, the most significant bit of the significand acts as this quiet/signaling bit: if that bit is 0, the NaN is signaling; if it is 1, the NaN is quiet.

The primary purpose of an sNaN is to trigger a floating-point exception, typically an invalid operation, when

In practice, platform and language implementations vary. Some hardware and software environments convert sNaNs to qNaNs

History and use of sNaNs have been shaped by the evolution of IEEE 754 revisions. While the

See also: NaN, IEEE 754, quiet NaN, signaling.

it
participates
in
arithmetic
or
other
IEEE
754
operations.
The
exact
behavior
depends
on
the
platform
and
the
floating-point
environment:
with
exceptions
enabled,
using
an
sNaN
usually
raises
an
invalid-operation
fault;
the
resulting
value
is
typically
NaN.
If
exceptions
are
masked
or
disabled,
the
operation
may
complete
and
yield
a
NaN,
potentially
a
qNaN,
without
signaling.
to
maintain
performance
and
compatibility,
often
masking
the
signaling
exception.
Others
retain
signaling
semantics
for
debugging
or
numerical
analysis.
As
a
result,
the
presence
of
sNaNs
and
their
diagnostic
value
can
be
inconsistent
across
systems.
concept
remains
defined,
real-world
support
is
heterogeneous,
making
sNaNs
less
relied
upon
for
portable
error
signaling
in
modern
software.