Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > IEEE754 fp

Reply
Thread Tools

IEEE754 fp

 
 
Ravishankar S
Guest
Posts: n/a
 
      02-14-2008
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




 
Reply With Quote
 
 
 
 
Ben Pfaff
Guest
Posts: n/a
 
      02-14-2008
"Ravishankar S" <(E-Mail Removed)> 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_
 
Reply With Quote
 
 
 
 
Martin Ambuhl
Guest
Posts: n/a
 
      02-14-2008
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.
 
Reply With Quote
 
Army1987
Guest
Posts: n/a
 
      02-14-2008
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")
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Intel FP h/w non-compliance to IEEE754 KeithWood Hardware 0 04-08-2011 08:49 AM
Portable IEEE754 write routine Malcolm McLean C Programming 7 02-19-2010 12:30 AM
Need a library to write/read floats and doubles in IEEE754 Pavel C++ 13 03-14-2008 04:01 PM



Advertisments