Linux forum

General discussion

C Program, Floating Point Standard

by eljim / April 8, 2004 2:26 AM PDT

Bits used for represent double in C under Linux RedHat.

Hi three,

Thank you for reading my message, I have a question for you,

Do you know what the C floating-point standard is under a RedHat computer?

I tried to find out it in google but I got information of IEEE 754 or IEEE 854, and the bits, that I am receiving, don't match with that standard, I am receiving, eg:

-2 = 11111110 11111111 11111111 11111111 00001000 00000000 00000000 00000000
-1 = 11111111 11111111 11111111 11111111 00001000 00000000 00000000 00000000
0 = 00000000 00000000 00000000 00000000 00001000 00000000 00000000 00000000
1 = 00000001 00000000 00000000 00000000 00001000 00000000 00000000 00000000
2 = 00000010 00000000 00000000 00000000 00001000 00000000 00000000 00000000
.1 = 10011010 10011001 10011001 10011001 10011001 10011001 10111001 00111111
.5 = 00000000 00000000 00000000 00000000 00000000 00000000 11100000 00111111

Let me know if this is an incorrect topic for this forum, if yes, do you know where it is the correct forum to post this topic?


Thanks in advance,

JB

Discussion is locked
You are posting a reply to: C Program, Floating Point Standard
The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our CNET Forums policies for details. All submitted content is subject to our Terms of Use.
Track this discussion and email me when there are updates

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

You are reporting the following post: C Program, Floating Point Standard
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
Collapse -
Re:C Program, Floating Point Standard
by eljim / April 8, 2004 4:50 AM PDT

An answer for myself and another person who face a problem like mine.

I was using double d = 1; But I should use double d = 1.0; So I was geeting the integer representation of the value. The floating point prtocol is IEEE 754 with a presicion of 10 bits. The information on a Linux system is little endian.

Thanks for reading my post,


JB

Collapse -
Re:Re:C Program, Floating Point Standard
by redbellusa / April 12, 2004 1:19 AM PDT

Had a similar problem where in I had defined some data as float and the program demanded a decimal point for any and all numerical input, either from from a file or from the keyboard. Chased that one for a day or so. I think that it was on a DEC Microvax running Unix under VMS.
Best of luck,
redbellusa

Popular Forums
icon
Computer Newbies 10,686 discussions
icon
Computer Help 54,365 discussions
icon
Laptops 21,181 discussions
icon
Networking & Wireless 16,313 discussions
icon
Phones 17,137 discussions
icon
Security 31,287 discussions
icon
TVs & Home Theaters 22,101 discussions
icon
Windows 7 8,164 discussions
icon
Windows 10 2,657 discussions

CNET FORUMS TOP DISCUSSION

Help, my PC with Windows 10 won't shut down properly

Since upgrading to Windows 10 my computer won't shut down properly. I use the menu button shutdown and the screen goes blank, but the system does not fully shut down. The only way to get it to shut down is to hold the physical power button down till it shuts down. Any suggestions?