IEEE754 fp

R

Ravishankar S

Hello C-Experts,

Is there any predefined constant in Std C which specifed that the
implementation uses the IEEE754
standard for floating point operation ?

Regards,
Ravishankar
 
B

Ben Pfaff

Ravishankar S said:
Is there any predefined constant in Std C which specifed that the
implementation uses the IEEE754
standard for floating point operation ?

C99 has __STDC_IEC_559__:

F.1 Introduction
1 This annex specifies C language support for the IEC 60559
floating-point standard. The IEC 60559 floating-point
standard is specifically Binary floating-point arithmetic
for microprocessor systems, second edition (IEC 60559:1989),
previously designated IEC 559:1989 and as IEEE Standard for
Binary Floating-Point Arithmetic (ANSI/IEEE 754-1985). IEEE
Standard for Radix-Independent Floating-Point Arithmetic
(ANSI/IEEE 854-1987) generalizes the binary standard to
remove dependencies on radix and word length. IEC 60559
generally refers to the floating-point standard, as in IEC
60559 operation, IEC 60559 format, etc. An implementation
that defines __STDC_IEC_559__ shall conform to the
specifications in this annex. Where a binding between the C
language and IEC 60559 is indicated, the IEC 60559-specified
behavior is adopted by reference, unless stated otherwise.
 
M

Martin Ambuhl

Ravishankar said:
Hello C-Experts,

Is there any predefined constant in Std C which specifed that the
implementation uses the IEEE754
standard for floating point operation ?

Note that the ANSI/IEEE 754, ANSI/IEEE 854, and IEC 559 designations
have been superseded by IEEE 60559.

If the implementation defines __STDC_IEC_559__ (the old name is used in
the macro) then the implementation shall conform to IEC 60559, in the
way specified in the annex to the C standard.
 
A

Army1987

Ravishankar said:
Hello C-Experts,

Is there any predefined constant in Std C which specifed that the
implementation uses the IEEE754
standard for floating point operation ?
__STDC_IEC_559__
But note that there are many implementations which partially conform to
the Annex F, and do not define __STDC_IEC_559__, even if, for example,
floating point numbers are stored with the IEEE754 representation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top