ISO/IEC TS 18661-3:2015
(Main)Information Technology - Programming languages, their environments, and system software interfaces - Floating-point extensions for C - Part 3: Interchange and extended types
Information Technology - Programming languages, their environments, and system software interfaces - Floating-point extensions for C - Part 3: Interchange and extended types
ISO/IEC TS 18661-3:2015 extends programming language C to include types with the arithmetic interchange and extended floating-‐point formats specified in ISO/IEC/IEEE 60559:2011, and to include functions that support the non-‐arithmetic interchange formats in that standard.
Technologies de l'information — Langages de programmation, leurs environnements et interfaces du logiciel système — Extensions à virgule flottante pour C — Partie 3: Types d'échange et étendus
General Information
Overview
ISO/IEC TS 18661-3:2015 - "Floating‑point extensions for C - Part 3: Interchange and extended types" - is a technical specification that extends the C programming language to support the arithmetic interchange and extended floating‑point formats defined in ISO/IEC/IEEE 60559:2011 (the modern IEEE‑754 family). The TS adds types, conversion rules and library support so C implementations can expose and manipulate wider and interchange floating‑point representations, and provides functions for the non‑arithmetic interchange encodings specified by 60559.
Key topics and requirements
- Language conformance: Rules for freestanding and hosted implementations, predefined macros and standard headers to declare new types and functionality.
- Types and characteristics: Definitions for interchange and extended floating‑point types (extensions to C’s abstract floating‑point model) and their implementation characteristics.
- Conversions and constants: Specifications for conversions between formats and for correctly formed constants in extended types.
- Expressions and evaluation: How expressions involving extended/interchange types are evaluated and how rounding and exceptions are handled.
- Library support: Additions to standard headers and functions, including:
- Math library <math.h> (macros, functions, floating‑point environment)
- Encoding conversion functions (for interchange formats)
- Numeric conversion routines in <stdlib.h>
- Complex arithmetic <complex.h> and type‑generic macros <tgmath.h>
- Non‑arithmetic interchange formats: Support functions for formats that are intended for data interchange but not for arithmetic operations.
- Conformance to IEEE/60559 guidance: Ensures C bindings align with features recommended by ISO/IEC/IEEE 60559:2011 (e.g., extended formats, interchange encodings, and more precise conversion semantics).
Applications and who uses it
ISO/IEC TS 18661-3:2015 is aimed at parties that need precise, portable floating‑point behavior beyond the default C types:
- Compiler and standard library implementers adding support for extended or interchange floating‑point formats.
- Embedded systems and firmware developers who must exchange binary floating‑point data across heterogeneous platforms.
- High‑performance computing and numerical software authors requiring wider precision types or reproducible cross‑platform results.
- Interoperability and data‑exchange engineers handling serialization/encoding of floating‑point values (including non‑arithmetic interchange formats).
- Testing labs and tool vendors verifying conformance with IEEE/60559 features in C environments.
Related standards
- ISO/IEC 9899:2011 (C11) - base C standard extended by TS 18661 series
- ISO/IEC/IEEE 60559:2011 - floating‑point arithmetic (IEEE‑754:2008 equivalent)
- Other parts of the TS 18661 series (Parts 1, 2, 4, and planned Part 5) address binary/decimal arithmetic, supplementary functions and attributes.
Keywords: ISO/IEC TS 18661-3:2015, floating‑point extensions for C, interchange types, extended types, ISO/IEC/IEEE 60559:2011, C standard, encoding conversion, math.h, floating‑point portability.
Frequently Asked Questions
ISO/IEC TS 18661-3:2015 is a technical specification published by the International Organization for Standardization (ISO). Its full title is "Information Technology - Programming languages, their environments, and system software interfaces - Floating-point extensions for C - Part 3: Interchange and extended types". This standard covers: ISO/IEC TS 18661-3:2015 extends programming language C to include types with the arithmetic interchange and extended floating-‐point formats specified in ISO/IEC/IEEE 60559:2011, and to include functions that support the non-‐arithmetic interchange formats in that standard.
ISO/IEC TS 18661-3:2015 extends programming language C to include types with the arithmetic interchange and extended floating-‐point formats specified in ISO/IEC/IEEE 60559:2011, and to include functions that support the non-‐arithmetic interchange formats in that standard.
ISO/IEC TS 18661-3:2015 is classified under the following ICS (International Classification for Standards) categories: 35.060 - Languages used in information technology. The ICS classification helps identify the subject area and facilitates finding related standards.
You can purchase ISO/IEC TS 18661-3:2015 directly from iTeh Standards. The document is available in PDF format and is delivered instantly after payment. Add the standard to your cart and complete the secure checkout process. iTeh Standards is an authorized distributor of ISO standards.
Standards Content (Sample)
TECHNICAL ISO/IEC TS
SPECIFICATION 18661-3
First edition
2015-10-01
Information Technology —
Programming languages, their
environments, and system software
interfaces — Floating-point
extensions for C —
Part 3:
Interchange and extended types
Technologies de l’information — Langages de programmation, leurs
environnements et interfaces du logiciel système — Extensions à
virgule flottante pour C —
Partie 3: Types d’échange et étendus
Reference number
©
ISO/IEC 2015
© ISO/IEC 2015, Published in Switzerland
�ll ri�ht� re�erved. �nle�� otherwi�e ��e�i�ied, no �art o� thi� ���li�ation �a� �e re�rod��ed or �tilized otherwi�e in an� �or�
or �� an� �ean�, ele�troni� or �e�hani�al, in�l�din� �hoto�o��in�, or �o�tin� on the internet or an intranet, witho�t �rior
written �er�i��ion. Per�i��ion �an �e re��e�ted �ro� either �S� at the addre�� �elow or �S��� �e��er �od� in the �o�ntr� o�
the requester.
�S� �o��ri�ht o��i�e
Ch. de Blandonnet 8 • CP 401
CH-1214 Vernier, Geneva, Switzerland
Tel. +41 22 749 01 11
Fax +41 22 749 09 47
�o��ri�ht�i�o.or�
www.iso.org
ii © ISO/IEC 2015 – All rights reserved
ISO/IEC
TS
18661-‐3:2015(E)
Foreword
.......................................................................................................................................................................
iv
Introduction
.................................................................................................................................................................
vi
Scope
.........................................................................................................................................................................
Conformance
..........................................................................................................................................................
Normative
references
.........................................................................................................................................
Terms
and
definitions
........................................................................................................................................
C
standard
conformance
....................................................................................................................................
5.1
Freestanding
implementations
....................................................................................................................
5.2
Predefined
macros
...........................................................................................................................................
5.3
Standard
headers
..............................................................................................................................................
Types
........................................................................................................................................................................
Characteristics
....................................................................................................................................................
Conversions
..........................................................................................................................................................
Constants
...............................................................................................................................................................
Expressions
........................................................................................................................................................
Non-‐arithmetic
interchange
formats
........................................................................................................
Mathematics
................................................................................................................................
12.1
Macros
..............................................................................................................................................................
12.2
Floating-‐point
environment
.....................................................................................................................
12.3
Functions
.........................................................................................................................................................
12.4
Encoding
conversion
functions
...............................................................................................................
Numeric
conversion
functions
in
....................................................................................
Complex
arithmetic
...........................................................................................................
Type-‐generic
macros
...........................................................................................................
Bibliography
................................................................................................................................................................
©
ISO/IEC
–
All
rights
reserved
iii
ISO/IEC
TS
18661-‐3:2015(E)
Foreword
ISO
(the
International
Organization
for
Standardization)
and
IEC
(the
International
Electrotechnical
Commission)
form
the
specialized
system
for
worldwide
standardization.
National
bodies
that
are
members
of
ISO
or
IEC
participate
in
the
development
of
International
Standards
through
technical
committees
established
by
the
respective
organization
to
deal
with
particular
fields
of
technical
activity.
ISO
and
IEC
technical
committees
collaborate
in
fields
of
mutual
interest.
Other
international
organizations,
governmental
and
non-‐governmental,
in
liaison
with
ISO
and
IEC,
also
take
part
in
the
work.
In
the
field
of
information
technology,
ISO
and
IEC
have
established
a
joint
technical
committee,
ISO/IEC
JTC
1.
The
procedures
used
to
develop
this
document
and
those
intended
for
its
further
maintenance
are
described
in
the
ISO/IEC
Directives,
Part
1.
In
particular
the
different
approval
criteria
needed
for
the
different
types
of
document
should
be
noted.
This
document
was
drafted
in
accordance
with
the
editorial
rules
of
the
ISO/IEC
Directives,
Part
(see
www.iso.org/directives).
Attention
is
drawn
to
the
possibility
that
some
of
the
elements
of
this
document
may
be
the
subject
of
patent
rights.
ISO
and
IEC
shall
not
be
held
responsible
for
identifying
any
or
all
such
patent
rights.
Details
of
any
patent
rights
identified
during
the
development
of
the
document
will
be
in
the
Introduction
and/or
on
the
ISO
list
of
patent
declarations
received
(see
www.iso.org/patents).
Any
trade
name
used
in
this
document
is
information
given
for
the
convenience
of
users
and
does
not
constitute
an
endorsement.
For
an
explanation
on
the
meaning
of
ISO
specific
terms
and
expressions
related
to
conformity
assessment,
as
well
as
information
about
ISO's
adherence
to
the
WTO
principles
in
the
Technical
Barriers
to
Trade
(TBT)
see
the
following
URL:
Foreword
-‐
Supplementary
information
The
committee
responsible
for
this
document
is
ISO/IEC
JTC
1,
Information
technology,
Subcommittee
SC
22,
Programming
languages,
their
environments,
and
system
software
interfaces.
ISO/IEC
TS
consists
of
the
following
parts,
under
the
general
title
Information
technology
—
Programming
languages,
their
environments,
and
system
software
interfaces
—
Floating-‐point
extensions
for
C:
⎯ Part
1:
Binary
floating-‐point
arithmetic
⎯ Part
2:
Decimal
floating-‐point
arithmetic
⎯ Part
3:
Interchange
and
extended
types
⎯ Part
4:
Supplementary
functions
The
following
part
is
under
preparation:
⎯ Part
5:
Supplementary
attributes
ISO/IEC
TS
18661-‐1
updates
ISO/IEC
9899:2011,
Information
technology
—
Programming
Language
C,
annex
F
in
particular,
to
support
all
required
features
of
ISO/IEC/IEEE
60559:2011,
Information
technology
—
Microprocessor
Systems
—
Floating-‐point
arithmetic.
ISO/IEC
TS
18661-‐2
supersedes
ISO/IEC
TR
24732:2009,
Information
technology
—
Programming
languages,
their
environments
and
system
software
interfaces
—
Extension
for
the
programming
language
C
to
support
decimal
floating-‐point
arithmetic.
iv
©
ISO/IEC
–
All
rights
reserved
ISO/IEC
TS
18661-‐3:2015(E)
ISO/IEC
TS
18661-‐3,
ISO/IEC
TS
18661-‐4,
and
ISO/IEC
TS
18661-‐5
specify
extensions
to
ISO/IEC
9899:2011
for
features
recommended
in
ISO/IEC/IEEE
60559:2011.
©
ISO/IEC
–
All
rights
reserved
v
ISO/IEC
TS
18661-‐3:2015(E)
Introduction
Background
IEC
floating-‐point
standard
The
IEEE
754-‐1985
standard
for
binary
floating-‐point
arithmetic
was
motivated
by
an
expanding
diversity
in
floating-‐point
data
representation
and
arithmetic,
which
made
writing
robust
programs,
debugging,
and
moving
programs
between
systems
exceedingly
difficult.
Now
the
great
majority
of
systems
provide
data
formats
and
arithmetic
operations
according
to
this
standard.
The
IEC
60559:1989
international
standard
was
equivalent
to
the
IEEE
754-‐1985
standard.
Its
stated
goals
were
the
following:
1 Facilitate
movement
of
existing
programs
from
diverse
computers
to
those
that
adhere
to
this
standard.
2 Enhance
the
capabilities
and
safety
available
to
programmers
who,
though
not
expert
in
numerical
methods,
may
well
be
attempting
to
produce
numerically
sophisticated
programs.
However,
we
recognize
that
utility
and
safety
are
sometimes
antagonists.
3 Encourage
experts
to
develop
and
distribute
robust
and
efficient
numerical
programs
that
are
portable,
by
way
of
minor
editing
and
recompilation,
onto
any
computer
that
conforms
to
this
standard
and
possesses
adequate
capacity.
When
restricted
to
a
declared
subset
of
the
standard,
these
programs
should
produce
identical
results
on
all
conforming
systems.
4 Provide
direct
support
for
a. Execution-‐time
diagnosis
of
anomalies
b. Smoother
handling
of
exceptions
c. Interval
arithmetic
at
a
reasonable
cost
5 Provide
for
development
of
a. Standard
elementary
functions
such
as
exp
and
cos
b. Very
high
precision
(multiword)
arithmetic
c. Coupling
of
numerical
and
symbolic
algebraic
computation
6 Enable
rather
than
preclude
further
refinements
and
extensions.
To
these
ends,
the
standard
specified
a
floating-‐point
model
comprising
the
following:
— formats
–
for
binary
floating-‐point
data,
including
representations
for
Not-‐a-‐Number
(NaN)
and
signed
infinities
and
zeros
—
operations
–
basic
arithmetic
operations
(addition,
multiplication,
etc.)
on
the
format
data
to
compose
a
well-‐defined,
closed
arithmetic
system;
also
specified
conversions
between
floating-‐
point
formats
and
decimal
character
sequences,
and
a
few
auxiliary
operations
—
context
–
status
flags
for
detecting
exceptional
conditions
(invalid
operation,
division
by
zero,
overflow,
underflow,
and
inexact)
and
controls
for
choosing
different
rounding
methods
vi
©
ISO/IEC
–
All
rights
reserved
ISO/IEC
TS
18661-‐3:2015(E)
The
ISO/IEC/IEEE
60559:2011
international
standard
is
equivalent
to
the
IEEE
754-‐2008
standard
for
floating-‐point
arithmetic,
which
is
a
major
revision
to
IEEE
754-‐1985.
The
revised
standard
specifies
more
formats,
including
decimal
as
well
as
binary.
It
adds
a
128-‐bit
binary
format
to
its
basic
formats.
It
defines
extended
formats
for
all
of
its
basic
formats.
It
specifies
data
interchange
formats
(which
may
or
may
not
be
arithmetic),
including
a
16-‐bit
binary
format
and
an
unbounded
tower
of
wider
formats.
To
conform
to
the
floating-‐point
standard,
an
implementation
must
provide
at
least
one
of
the
basic
formats,
along
with
the
required
operations.
The
revised
standard
specifies
more
operations.
New
requirements
include
–
among
others
–
arithmetic
operations
that
round
their
result
to
a
narrower
format
than
the
operands
(with
just
one
rounding),
more
conversions
with
integer
types,
more
classifications
and
comparisons,
and
more
operations
for
managing
flags
and
modes.
New
recommendations
include
an
extensive
set
of
mathematical
functions
and
seven
reduction
functions
for
sums
and
scaled
products.
The
revised
standard
places
more
emphasis
on
reproducible
results,
which
is
reflected
in
its
standardization
of
more
operations.
For
the
most
part,
behaviors
are
completely
specified.
The
standard
requires
conversions
between
floating-‐point
formats
and
decimal
character
sequences
to
be
correctly
rounded
for
at
least
three
more
decimal
digits
than
is
required
to
distinguish
all
numbers
in
the
widest
supported
binary
format;
it
fully
specifies
conversions
involving
any
number
of
decimal
digits.
It
recommends
that
transcendental
functions
be
correctly
rounded.
The
revised
standard
requires
a
way
to
specify
a
constant
rounding
direction
for
a
static
portion
of
code,
with
details
left
to
programming
language
standards.
This
feature
potentially
allows
rounding
control
without
incurring
the
overhead
of
runtime
access
to
a
global
(or
thread)
rounding
mode.
Other
features
recommended
by
the
revised
standard
include
alternate
methods
for
exception
handling,
controls
for
expression
evaluation
(allowing
or
disallowing
various
optimizations),
support
for
fully
reproducible
results,
and
support
for
program
debugging.
The
revised
standard,
like
its
predecessor,
defines
its
model
of
floating-‐point
arithmetic
in
the
abstract.
It
neither
defines
the
way
in
which
operations
are
expressed
(which
might
vary
depending
on
the
computer
language
or
other
interface
being
used),
nor
does
it
define
the
concrete
representation
(specific
layout
in
storage,
or
in
a
processor's
register,
for
example)
of
data
or
context,
except
that
it
does
define
specific
encodings
that
are
to
be
used
for
the
exchange
of
floating-‐point
data
between
different
implementations
that
conform
to
the
specification.
IEC
does
not
include
bindings
of
its
floating-‐point
model
for
particular
programming
languages.
However,
the
revised
standard
does
include
guidance
for
programming
language
standards,
in
recognition
of
the
fact
that
features
of
the
floating-‐point
standard,
even
if
well
supported
in
the
hardware,
are
not
available
to
users
unless
the
programming
language
provides
a
commensurate
level
of
support.
The
implementation’s
combination
of
both
hardware
and
software
determines
conformance
to
the
floating-‐point
standard.
C
support
for
IEC
The
C
standard
specifies
floating-‐point
arithmetic
using
an
abstract
model.
The
representation
of
a
floating-‐point
number
is
specified
in
an
abstract
form
where
the
constituent
components
(sign,
exponent,
significand)
of
the
representation
are
defined
but
not
the
internals
of
these
components.
In
particular,
the
exponent
range,
significand
size,
and
the
base
(or
radix)
are
implementation-‐defined.
This
allows
flexibility
for
an
implementation
to
take
advantage
of
its
underlying
hardware
architecture.
Furthermore,
certain
behaviors
of
operations
are
also
implementation-‐defined,
for
example
in
the
area
of
handling
of
special
numbers
and
in
exceptions.
©
ISO/IEC
–
All
rights
reserved
vii
ISO/IEC
TS
18661-‐3:2015(E)
The
reason
for
this
approach
is
historical.
At
the
time
when
C
was
first
standardized,
before
the
floating-‐
point
standard
was
established,
there
were
various
hardware
implementations
of
floating-‐point
arithmetic
in
common
use.
Specifying
the
exact
details
of
a
representation
would
have
made
most
of
the
existing
implementations
at
the
time
not
conforming.
Beginning
with
ISO/IEC
9899:1999
(C99),
C
has
included
an
optional
second
level
of
specification
for
implementations
supporting
the
floating-‐point
standard.
C99,
in
conditionally
normative
annex
F,
introduced
nearly
complete
support
for
the
IEC
60559:1989
standard
for
binary
floating-‐point
arithmetic.
Also,
C99’s
informative
annex
G
offered
a
specification
of
complex
arithmetic
that
is
compatible
with
IEC
60559:1989.
ISO/IEC
9899:2011
(C11)
includes
refinements
to
the
C99
floating-‐point
specification,
though
it
is
still
based
on
IEC
60559:1989.
C11
upgraded
annex
G
from
“informative”
to
“conditionally
normative”.
ISO/IEC
TR
24732:2009
introduced
partial
C
support
for
the
decimal
floating-‐point
arithmetic
in
ISO/IEC/IEEE
60559:2011.
ISO/IEC
TR
24732,
for
which
technical
content
was
completed
while
IEEE
754-‐2008
was
still
in
the
later
stages
of
development,
specifies
decimal
types
based
on
ISO/IEC/IEEE
60559:2011
decimal
formats,
though
it
does
not
include
all
of
the
operations
required
by
ISO/IEC/IEEE
60559:2011.
Purpose
The
purpose
of
ISO/IEC
TS
is
to
provide
a
C
language
binding
for
ISO/IEC/IEEE
60559:2011,
based
on
the
C11
standard,
that
delivers
the
goals
of
ISO/IEC/IEEE
to
users
and
is
feasible
to
implement.
It
is
organized
into
five
parts.
ISO/IEC
TS
18661-1
provides
changes
to
C11
that
cover
all
the
requirements,
plus
some
basic
recommendations,
of
ISO/IEC/IEEE
60559:2011
for
binary
floating-‐point
arithmetic.
C
implementations
intending
to
support
ISO/IEC/IEEE
60559:2011
are
expected
to
conform
to
conditionally
normative
annex
F
as
enhanced
by
the
changes
in
ISO/IEC
TS
18661-1.
ISO/IEC
TS
18661-2
enhances
ISO/IEC
TR
to
cover
all
the
requirements,
plus
some
basic
recommendations,
of
ISO/IEC/IEEE
60559:2011
for
decimal
floating-‐point
arithmetic.
C
implementations
intending
to
provide
an
extension
for
decimal
floating-‐point
arithmetic
supporting
ISO/IEC/IEEE
60559:2011
are
expected
to
conform
to
ISO/IEC
TS
18661-2.
ISO/IEC
TS
18661-3
(Interchange
and
extended
types),
ISO/IEC
TS
18661-4
(Supplementary
functions),
and
ISO/IEC
TS
18661-5
(Supplementary
attributes)
cover
recommended
features
of
ISO/IEC/IEEE
60559:2011.
C
implementations
intending
to
provide
extensions
for
these
features
are
expected
to
conform
to
the
corresponding
parts.
Additional
background
on
formats
The
revised
floating-‐point
arithmetic
standard,
ISO/IEC/IEEE
60559:2011,
introduces
a
variety
of
new
formats,
both
fixed
and
extendable.
The
new
fixed
formats
include
—
a
128-‐bit
basic
binary
format
(the
and
bit
basic
binary
formats
are
carried
over
from
ISO/IEC
60559:1989)
—
and
bit
basic
decimal
formats
viii
©
ISO/IEC
–
All
rights
reserved
ISO/IEC
TS
18661-‐3:2015(E)
—
interchange
formats,
whose
precision
and
range
are
determined
by
the
width
k,
where
for
binary,
k
=
16,
32,
64,
and
k
≥
and
a
multiple
of
32,
and
for
decimal,
k
≥
and
a
multiple
of
—
extended
formats,
for
each
basic
format,
with
minimum
range
and
precision
specified
Thus
IEC
defines
five
basic
formats
—
binary32,
binary64,
binary128,
decimal64,
and
decimal128
—
and
five
corresponding
extended
formats,
each
with
somewhat
more
precision
and
range
than
the
basic
format
it
extends.
IEC
defines
an
unlimited
number
of
interchange
formats,
which
include
the
basic
formats.
Interchange
formats
may
or
may
not
be
supported
as
arithmetic
formats.
If
not,
they
may
be
used
for
the
interchange
of
floating-‐point
data
but
not
for
arithmetic
computation.
IEC
provides
conversions
between
non-‐arithmetic
interchange
formats
and
arithmetic
formats
which
can
be
used
for
computation.
Extended
formats
are
intended
for
intermediate
computation,
not
input
or
output
data.
The
extra
precision
often
allows
the
computation
of
extended
results
which
when
converted
to
a
narrower
output
format
differ
from
the
ideal
results
by
little
more
than
a
unit
in
the
last
place.
Also,
the
extra
range
often
avoids
any
intermediate
overflow
or
underflow
that
might
occur
if
the
computation
were
done
in
the
format
of
the
data.
The
essential
property
of
extended
formats
is
their
sufficient
extra
widths,
not
their
specific
widths.
Extended
formats
for
any
given
basic
format
may
vary
among
implementations.
Extendable
formats,
which
provide
user
control
over
range
and
precision,
are
not
covered
in
ISO/IEC
TS
18661.
The
and
bit
binary
formats
are
supported
in
C
by
types
float
and
double.
If
a
C
implementation
defines
the
macro
__STDC_IEC_60559_BFP__
(see
ISO/IEC
TS
18661-‐1)
signifying
that
it
supports
C
Annex
F
for
binary
floating-‐point
arithmetic,
then
its
float
and
double
formats
must
be
IEC
binary32
and
binary64.
ISO/IEC
TS
18661-‐2
defines
types
_Decimal32,
_Decimal64,
and
_Decimal128
with
IEC
formats
decimal32,
decimal64,
and
decimal128.
Although
IEC
does
not
require
arithmetic
support
(other
than
conversions)
for
its
decimal32
interchange
format,
ISO/IEC
TS
18661-‐2
has
full
arithmetic
and
library
support
for
_Decimal32,
just
like
for
_Decimal64
and
_Decimal128.
The
C
Standard
provides
just
three
standard
floating
types
(float,
double,
and
long double)
that
are
required
of
all
implementations.
C
Annex
F
for
binary
floating-‐point
arithmetic
requires
the
standard
floating
types
to
be
binary.
The
long double
type
must
be
at
least
as
wide
as
double,
but
C
does
not
further
specify
details
of
its
format,
even
in
Annex
F.
ISO/IEC
TS
18661-‐3,
this
document,
provides
nomenclatures
for
types
with
IEC
arithmetic
interchange
formats
and
extended
formats.
The
nomenclatures
allow
portable
use
of
the
formats
as
envisioned
in
IEC
60559.
This
document
covers
these
aspects
of
the
types:
— names
— characteristics
— conversions
©
ISO/IEC
–
All
rights
reserved
ix
ISO/IEC
TS
18661-‐3:2015(E)
— constants
— function
suffixes
— character
sequence
conversion
interfaces
This
specification
includes
interchange
and
extended
nomenclatures
for
formats
that,
in
some
cases,
already
have
C
nomenclatures.
For
example,
types
with
the
IEC
double
format
may
include
double,
_Float64
(the
type
for
the
binary64
interchange
format),
and
maybe
_Float32x
(the
type
for
the
binary32-‐extended
format).
This
redundancy
is
intended
to
support
the
different
programming
models
appropriate
for
the
types
with
arithmetic
interchange
formats
and
extended
formats
and
C
standard
floating
types.
This
document
also
supports
the
IEC
non-‐arithmetic
interchange
formats
with
functions
that
convert
among
encodings
and
between
encodings
and
character
sequences,
for
all
interchange
formats.
x
©
ISO/IEC
–
All
rights
reserved
TECHNICAL
SPECIFICATION
ISO/IEC/TS
18661-‐3:2015(E)
Information
technology
—
Programming
languages,
their
environments,
and
system
software
interfaces
—
Floating-‐point
extensions
for
C
—
Part
3:
Interchange
and
extended
types
Scope
This
part
of
ISO/IEC
TS
extends
programming
language
C
to
include
types
with
the
arithmetic
interchange
and
extended
floating-‐point
formats
specified
in
ISO/IEC/IEEE
60559:2011,
and
to
include
functions
that
support
the
non-‐arithmetic
interchange
formats
in
that
standard.
Conformance
An
implementation
conforms
to
this
part
of
ISO/IEC
TS
if
a) it
meets
the
requirements
for
a
conforming
implementation
of
C11
with
all
the
changes
to
C11
specified
in
parts
1-‐3
of
ISO/IEC
TS
18661;
b) it
conforms
to
ISO/IEC
TS
18661-‐1
or
ISO/IEC
TS
18661-‐2
(or
both);
and
c) it
defines
__STDC_IEC_60559_TYPES__
to
201506L.
Normative
references
The
following
documents,
in
whole
or
in
part,
are
normatively
referenced
in
this
document
and
are
indispensable
for
its
application.
For
dated
references,
only
the
edition
cited
applies.
For
undated
references,
the
latest
edition
of
the
referenced
document
(including
any
amendments)
applies.
ISO/IEC
9899:2011,
Information
technology
—
Programming
languages
—
C
ISO/IEC/IEEE
60559:2011,
Information
technology
—
Microprocessor
Systems
—
Floating-‐point
arithmetic
ISO/IEC
TS
18661-‐1:2014,
Information
technology
—
Programming
languages,
their
environments
and
system
software
interfaces
—
Floating-‐point
extensions
for
C
—
Part
1:
Binary
floating-‐point
arithmetic
ISO/IEC
TS
18661-‐2:2015,
Information
technology
—
Programming
languages,
their
environments
and
system
software
interfaces
—
Floating-‐point
extensions
for
C
—
Part
2:
Decimal
floating-‐point
arithmetic
Terms
and
definitions
For
the
purposes
of
this
document,
the
terms
and
definitions
given
in
ISO/IEC
9899:2011,
ISO/IEC/IEEE
60559:2011,
ISO/IEC
TS
18661-‐1:2014,
ISO/IEC
TS
18661-‐2:2015,
and
the
following
apply.
©
ISO/IEC
–
All
rights
reserved
ISO/IEC
TS
18661-‐3:2015(E)
4.1
C11
standard
ISO/IEC
9899:2011,
Information
technology
—
Programming
languages
C,
including
Technical
Corrigendum
(ISO/IEC
9899:2011/Cor.
1:2012)
C
standard
conformance
5.1
Freestanding
implementations
The
specification
in
C11
+
TS18661-‐1
+
TS18661-‐2
allows
freestanding
implementations
to
conform
to
this
part
of
ISO/IEC
TS
18661.
5.2
Predefined
macros
Change
to
C11
+
TS18661-‐1
+
TS18661-‐2:
In
6.10.8.3#1,
add:
__STDC_IEC_60559_TYPES__
The
integer
constant
201506L,
intended
to
indicate
support
of
interchange
and
extended
floating
types
according
to
IEC
60559.
5.3
Standard
headers
The
new
identifiers
added
to
C11
library
headers
by
this
part
of
ISO/IEC
TS
are
defined
or
declared
by
their
respective
headers
only
if
__STDC_WANT_IEC_60559_TYPES_EXT__ is
defined
as
a
macro
at
the
point
in
the
source
file
where
the
appropriate
header
is
first
included.
The
following
changes
to
C11
+
TS18661-‐1
+
TS18661-‐2
list
these
identifiers
in
each
applicable
library
subclause.
Changes
to
C11
+
TS18661-‐1
+
TS18661-‐2:
After
5.2.4.2.2#6b,
insert
the
paragraph:
[6c]
The
following
identifiers
are
defined
only
if
__STDC_WANT_IEC_60559_TYPES_EXT__
is
defined
as
a
macro
at
the
point
in
the
source
file
where
is
first
included:
for
supported
types
_FloatN:
FLTN_MANT_DIG FLTN_MIN_10_EXP FLTN_EPSILON
FLTN_DECIMAL_DIG FLTN_MAX_EXP FLTN_MIN
FLTN_DIG FLTN_MAX_10_EXP FLTN_TRUE_MIN
FLTN_MIN_EXP FLTN_MAX
for
supported
types
_FloatNx:
FLTNX_MANT_DIG FLTNX_MIN_10_EXP FLTNX_EPSILON
FLTNX_DECIMAL_DIG FLTNX_MAX_EXP FLTNX_MIN
FLTNX_DIG FLTNX_MAX_10_EXP FLTNX_TRUE_MIN
FLTNX_MIN_EXP FLTNX_MAX
©
ISO/IEC
–
All
rights
reserved
ISO/IEC
TS
18661-‐3:2015(E)
for
supported
types
_DecimalN,
where
N
≠
32,
64,
and
128:
DECN_MANT_DIG DECN_MAX DECN_TRUE_MIN
DECN_MIN_EXP DECN_EPSILON
DECN_MAX_EXP DECN_MIN
for
supported
types
_DecimalNx:
DECNX_MANT_DIG DECNX_MAX DECNX_TRUE_MIN
DECNX_MIN_EXP DECNX_EPSILON
DECNX_MAX_EXP DECNX_MIN
After
7.3#2,
insert
the
paragraph:
[2a]
The
following
identifiers
are
declared
or
defined
only
if
__STDC_WANT_IEC_60559_TYPES_EXT__
is
defined
as
a
macro
at
the
point
in
the
source
file
where
is
first
included:
for
supported
types
_FloatN:
cacosfN catanhfN csqrtfN
casinfN ccoshfN cargfN
catanfN csinhfN cimagfN
ccosfN ctanhfN CMPLXFN
csinfN cexpfN conjfN
ctanfN clogfN cprojfN
cacoshfN cabsfN crealfN
casinhfN cpowfN
for
supported
types
_FloatNx:
cacosfNx catanhfNx csqrtfNx
casinfNx ccoshfNx cargfNx
catanfNx csinhfNx cimagfNx
ccosfNx ctanhfNx CMPLXFNX
csinfNx cexpfNx conjfNx
ctanfNx clogfNx cprojfNx
cacoshfNx cabsfNx crealfNx
casinhfNx cpowfNx
After
7.12#1c,
insert
the
paragraph:
[1d]
The
following
identifiers
are
defined
or
declared
only
if
__STDC_WANT_IEC_60559_TYPES_EXT__
is
defined
as
a
macro
at
the
point
in
the
source
file
where
is
first
included:
long_double_t
for
supported
types
_FloatN:
_FloatN_t log1pfN fromfpfN
HUGE_VAL_FN log2fN ufromfpfN
©
ISO/IEC
–
All
rights
reserved
ISO/IEC
TS
18661-‐3:2015(E)
SNANFN logbfN fromfpxfN
FP_FAST_FMAFN modffN ufromfpxfN
acosfN scalbnfN fmodfN
asinfN scalblnfN remainderfN
atanfN cbrtfN remquofN
atan2fN fabsfN copysignfN
cosfN hypotfN nanfN
sinfN powfN nextafterfN
tanfN sqrtfN nextupfN
acoshfN erffN nextdownfN
asinhfN erfcfN canonicalizefN
atanhfN lgammafN encodefN
coshfN tgammafN decodefN
sinhfN ceilfN fdimfN
tanhfN floorfN fmaxfN
expfN nearbyintfN fminfN
exp2fN rintfN fmaxmagfN
expm1fN lrintfN fminmagfN
frexpfN llrintfN fmafN
ilogbfN roundfN totalorderfN
ldexpfN lroundfN totalordermagfN
llogbfN llroundfN getpayloadfN
logfN truncfN setpayloadfN
log10fN roundevenfN setpayloadsigfN
for
supported
types
_FloatNx:
HUGE_VAL_FNX logbfNx fromfpfNx
SNANFNX modffNx ufromfpfNx
FP_FAST_FMAFNX scalbnfNx fromfpxfNx
acosfNx scalblnfNx ufromfpxfNx
asinfNx cbrtfNx fmodfNx
atanfNx fabsfNx remainderfNx
atan2fNx hypotfNx remquofNx
cosfNx powfNx copysignfNx
sinfNx sqrtfNx nanfNx
tanfNx erffNx nextafterfNx
acoshfNx erfcfNx nextupfNx
asinhfNx lgammafNx nextdownfNx
atanhfNx tgammafNx canonicalizefNx
expfNx ceilfNx fdimfNx
exp2fNx floorfNx fmaxfNx
expm1fNx nearbyintfNx fminfNx
frexpfNx rintfNx fmaxmagfNx
ilogbfNx lrintfNx fminmagfNx
llogbfNx llrintfNx fmafNx
ldexpfNx roundfNx totalorderfNx
logfNx lroundfNx totalordermagfNx
©
ISO/IEC
–
All
rights
reserved
ISO/IEC
TS
18661-‐3:2015(E)
log10fNx llroundfNx getpayloadfNx
log1pfNx truncfNx setpayloadfNx
log2fNx roundevenfNx setpayloadsigfNx
for
supported
types
_FloatM
and
_FloatN
where
M
<
N:
FP_FAST_FMADDFN FP_FAST_FMFMAFN fMmulfN
FP_FAST_FMSUBFN FP_FAST_FMSQRTFN fMdivfN
FP_FAST_FMMULFN fMaddfN fMfmafN
FP_FAST_FMDIVFN fMsubfN fMsqrtfN
for
supported
types
_FloatM
and
_FloatNx
where
M
≤
N:
FP_FAST_FMADDFNX FP_FAST_FMFMAFNX fMmulfNx
FP_FAST_FMSUBFNX FP_FAST_FMSQRTFNX fMdivfNx
FP_FAST_FMMULFNX fMaddfNx fMfmafNx
FP_FAST_FMDIVFNX fMsubfNx fMsqrtfNx
for
supported
types
_FloatMx
and
_FloatN
where
M
<
N:
FP_FAST_FMXADDFN FP_FAST_FMXFMAFN fMxmulfN
FP_FAST_FMXSUBFN FP_FAST_FMXSQRTFN fMxdivfN
FP_FAST_FMXMULFN fMxaddfN fMxfmafN
FP_FAST_FMXDIVFN fMxsubfN fMxsqrtfN
for
supported
types
_FloatMx
and
_FloatNx
where
M
<
N:
FP_FAST_FMXADDFNX FP_FAST_FMXFMAFNX fMxmulfNx
FP_FAST_FMXSUBFNX FP_FAST_FMXSQRTFNX fMxdivfNx
FP_FAST_FMXMULFNX fMxaddfNx fMxfmafNx
FP_FAST_FMXDIVFNX fMxsubfNx fMxsqrtfNx
for
supported
IEC
arithmetic
or
non-‐arithmetic
binary
interchange
formats
of
widths
M
and
N:
fMencfN
for
supported
types
_DecimalN,
where
N
≠
32,
64,
and
128:
_DecimalN_t logbdN fmoddN
HUGE_VAL_DN modfdN remainderdN
SNANDN scalbndN copysigndN
FP_FAST_FMADN scalblndN nandN
acosdN cbrtdN nextafterdN
asindN fabsdN nextupdN
atandN hypotdN nextdowndN
atan2dN powdN canonicalizedN
cosdN sqrtdN quantizedN
sindN erfdN samequantumdN
tandN erfcdN quantumdN
acoshdN lgammadN llquantexpdN
asinhdN tgammadN encodedecdN
©
ISO/IEC
–
All
rights
reserved
ISO/IEC
TS
18661-‐3:2015(E)
atanhdN ceildN decodedecdN
coshdN floordN encodebindN
sinhdN nearbyintdN decodebindN
tanhdN rintdN fdimdN
expdN lrintdN fmaxdN
exp2dN llrintdN fmindN
expm1dN rounddN fmaxmagdN
frexpdN lrounddN fminmagdN
ilogbdN llrounddN fmadN
llogbdN truncdN totalorderdN
ldexpdN roundevendN totalordermagdN
logdN fromfpdN getpayloaddN
log10dN ufromfpdN setpayloaddN
log1pdN fromfpxdN setpayloadsigdN
log2dN ufromfpxdN
for
supported
types
_DecimalNx:
HUGE_VAL_DNX log2dNx ufromfpdNx
SNANDNX logbdNx fromfpxdNx
FP_FAST_FMADNX modfdNx ufromfpxdNx
acosdNx scalbndNx fmoddNx
asindNx scalblndNx remainderdNx
atandNx cbrtdNx copysigndNx
atan2dNx fabsdNx nandNx
cosdNx hypotdNx nextafterdNx
sindNx powdNx nextupdNx
tandNx sqrtdNx nextdowndNx
acoshdNx erfdNx canonicalizedNx
asinhdNx erfcdNx quantizedNx
atanhdNx lgammadNx samequantumdNx
coshdNx tgammadNx quantumdNx
sinhdNx ceildNx llquantexpdNx
tanhdNx floordNx fdimdNx
expdNx nearbyintdNx fmaxdNx
exp2dNx rintdNx fmindNx
expm1dNx lrintdNx fmaxmagdNx
frexpdNx llrintdNx fminmagdNx
ilogbdNx rounddNx fmadNx
x totalorderdNx
llogbdNx lrounddN
ldexpdNx llrounddNx totalordermagdNx
logdNx truncdNx getpayloaddNx
log10dNx roundevendNx setpayloaddNx
log1pdNx fromfpdNx setpayloadsigdNx
©
ISO/IEC
–
All
rights
reserved
ISO/IEC
TS
18661-‐3:2015(E)
for
supported
types
_DecimalM
and
_DecimalN
where
M
<
N
and
M
and
N
are
not
both
one
of
32,
64,
and
128:
FP_FAST_DMADDDN
FP_FAST_DMFMADN
dMmuldN
FP_FAST_DMSUBDN
FP_FAST_DMSQRTDN
dMdivdN
FP_FAST_DMMULDN dMadddN
dMfmadN
FP_FAST_DMDIVDN dMsubdN
dMsqrtdN
for
supported
types
_DecimalM
and
_DecimalNx
where
M
≤
N:
FP_FAST_DMADDDNX
FP_FAST_DMFMADNX dMmuldNx
FP_FAST_DMSUBDNX
FP_FAST_DMSQRTDNX dMdivdNx
FP_FAST_DMMULDNX dMadddNx
dMfmadNx
FP_FAST_DMDIVDNX dMsubdNx
dMsqrtdNx
for
supported
types
_DecimalMx
and
_DecimalN
where
M
<
N:
FP_FAST_DMXADDDN
FP_FAST_DMXFMADN
dMxmuldN
FP_FAST_DMXSUBDN
FP_FAST_DMXSQRTDN
dMxdivdN
FP_FAST_DMXMULDN
dMxadddN
dMxfmadN
FP_FAST_DMXDIVDN
dMxsubdN
dMxsqrtdN
for
supported
types
_DecimalMx
and
_DecimalNx
where
M
<
N:
FP_FAST_DMXADDDNX
FP_FAST_DMXFMADNX dMxmuldNx
FP_FAST_DMXSUBDNX
FP_FAST_DMXSQRTDNX dMxdivdNx
FP_FAST_DMXMULDNX
dMxadddNx
dMxfmadNx
FP_FAST_DMXDIVDNX
dMxsubdNx
dMxsqrtdNx
for
supported
IEC
arithmetic
and
non-‐arithmetic
decimal
interchange
formats
of
widths
M
and
N:
dMencdecdN
dMencbindN
After
7.22#1b,
insert
the
paragraph:
[1c]
The
following
identifiers
are
declared
only
if
__STDC_WANT_IEC_60559_TYPES_EXT__
is
defined
as
a
macro
at
the
point
in
the
source
file
where
is
first
included:
for
supported
types
_FloatN:
strfromfN strtofN
for
supported
types
_FloatNx:
strfromfNx strto
...








Questions, Comments and Discussion
Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.
Loading comments...