473,406 Members | 2,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Hex to IEEE format

is ther any function in c or vc++ to convert the hex value to floating point value as per ieee format. i searched google but confused with the result what actuallt they do.
Sep 19 '07 #1
3 3030
weaknessforcats
9,208 Expert Mod 8TB
Use a stringstream:

Expand|Select|Wrap|Line Numbers
  1. stringstream ss;
  2.     ss << 0X1A;
  3.     double result;
  4.     ss >> result;
  5.     cout << result << endl;
  6.  
  7.     //Or use a string
  8.     ss.flush();
  9.     string str("0x1A");
  10.     ss << str;
  11.     ss >> result;
  12.     cout << result << endl;
  13.  
Sep 23 '07 #2
Hi,
Thanks for ur reply. But u havent mentioned what is the value of result and i hope the ss is the hex format value.
Sep 28 '07 #3
weaknessforcats
9,208 Expert Mod 8TB
result is a double. The hex value is in the double.

ss is a stringstream object. You may want to refresh your memory about this type.

Try the code.
Sep 28 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: franzkowiak | last post by:
Hello, I've read some bytes from a file and just now I can't interpret 4 bytes in this dates like a real value. An extract from my program def l32(c): return ord(c) + (ord(c)<<8) +...
0
by: Ernst Murnleitner | last post by:
Dear readers, Maybe someone can help: I need to exchange data with a PLC. My computer (Linux on intel) uses the intel format (little endian), the other device uses the motorola format (big...
2
by: Madhusudan Singh | last post by:
I am querying an instrument in a measurement application. The values are returned as IEEE format binary floating point numbers. There are 4 bytes per point. Multiple points are not separated by...
2
by: respect | last post by:
i want to convert real float number to 32-bit IEEE binary format in C++ ? plz help me in finding the codes as fast as u can ] Example for input -6.5, the output should be. 1 10000001...
1
by: GooglePoster | last post by:
Hello, I am looking for a function/utility to read in an IEEE value and convert this to decimal, for testing purposes. Also, I need to convert decimal values to IEEE values to send out on a...
54
by: Andy | last post by:
Hi, I don't know if this is the correct group to post this, but when I multiply a huge floating point value by a really small (non-zero) floating point value, I get 0 (zero) for the result. This...
2
by: Benjamin Rutt | last post by:
Does anyone have C code laying around to do this? I have to read in some binary data files that contains some 4-byte IBM/370 floating point values. I would like a function to convert 4-byte...
1
by: Faezeh | last post by:
I want to read 4 byte with IEEE floating point format and convert to decimal number in vb.net, and need to function for shift bits to left in vb .net. 32 bit IEEE floating point has this format: ...
13
by: revuesbio | last post by:
Hi Does anyone have the python version of the conversion from msbin to ieee? Thank u
5
by: JingL | last post by:
Hi, I am trying to convert 4 bytes to IEEE 32 Bit Floating point format in C# .Net the bytes format is: 41 20 00 00 Can anyone help me?
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.