Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C Programming (http://www.velocityreviews.com/forums/f42-c-programming.html)
-   -   IEEE754 fp (http://www.velocityreviews.com/forums/t591605-ieee754-fp.html)

Ravishankar S 02-14-2008 05:29 AM

IEEE754 fp
 
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





Ben Pfaff 02-14-2008 06:12 AM

Re: IEEE754 fp
 
"Ravishankar S" <ravishankar.s@in.bosch.com> writes:

> 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.

--
"When in doubt, treat ``feature'' as a pejorative.
(Think of a hundred-bladed Swiss army knife.)"
--Kernighan and Plauger, _Software Tools_

Martin Ambuhl 02-14-2008 07:25 AM

Re: IEEE754 fp
 
Ravishankar S wrote:
> 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.

Army1987 02-14-2008 01:17 PM

Re: IEEE754 fp
 
Ravishankar S wrote:

> 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.


--
Army1987 (Replace "NOSPAM" with "email")


All times are GMT. The time now is 10:57 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.