473,386 Members | 1,712 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,386 software developers and data experts.

Signed binary values

I'm receiving a signed (highest order bit indicates positive/negative) 2
byte value that I want to convert to a floating point number. Is there an
easy way to do this?

TIA

Brad
Nov 21 '05 #1
2 988
Look up "BitConvertor", try the ToInt16 method. Presumably this isn't a
floating point number (by format?). Is it fixed point?
"Bradley" <dm********@indesign-llc.com> wrote in message
news:OD**************@TK2MSFTNGP15.phx.gbl...
I'm receiving a signed (highest order bit indicates positive/negative) 2
byte value that I want to convert to a floating point number. Is there an
easy way to do this?

TIA

Brad

Nov 21 '05 #2
Robin,

Thanks. That's exactly what I was looking for.

Brad

"Robin Tucker" <id*************************@reallyidont.com> wrote in
message news:d7*******************@news.demon.co.uk...
Look up "BitConvertor", try the ToInt16 method. Presumably this isn't a
floating point number (by format?). Is it fixed point?
"Bradley" <dm********@indesign-llc.com> wrote in message
news:OD**************@TK2MSFTNGP15.phx.gbl...
I'm receiving a signed (highest order bit indicates positive/negative) 2
byte value that I want to convert to a floating point number. Is there
an easy way to do this?

TIA

Brad


Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: MiniDisc_2k2 | last post by:
Okay, here's a question about the standard. What does it say about unsigned/signed mismatches in a comparison statement: char a = 3; unsigned char b = 255; if (a<b) Now what's the real...
8
by: Rade | last post by:
Following a discussion on another thread here... I have tried to understand what is actually standardized in C++ regarding the representing of integers (signed and unsigned) and their conversions....
6
by: Sona | last post by:
Hi, What is the difference between a signed 0x00 (NULL, or 0) and an unsigned 0x00? Can there be one? If I do the following: char var; var = 0x00; what should var hold? and if it was an...
9
by: Fred Ma | last post by:
Hello, I've been trying to clear up a confusion about integer promotions during expression evaluation. I've checked the C FAQ and C++ FAQ (they are different languages, but I was hoping one...
4
by: Ken Tough | last post by:
Seems like a simple thing to find out, but I'm struggling. I have googled, but everything I find is about implicit conversion, not explicit. Is this implementation-specific, or does ANSI/ISO...
33
by: Daniel Fadlun | last post by:
Is there a bigger, mathematical, data type in C than the double (64 bit) one or the old long double (80 bit)? I'd like to add precision to my mathematical application, but I can't figure out how....
14
by: junky_fellow | last post by:
Can anybody please explain this: When a value with integer type is converted to another integer type other than _Bool, if the new type is unsigned, the value is converted by repeatedly...
14
by: me2 | last post by:
I am writing a little base conversion utility called base.c. This is what base does. $ base -127 Signed decimal: -127 Unsigned decimal: 4294967169 Hexidecimal: ...
26
by: John Harrison | last post by:
I have a problem. I want to compare an integral value, n, against three half open ranges as follows [-A, 0) // range 1 [0, B) // range 2 [B, C} // range 3 Each range corresponds to a...
39
by: Juha Nieminen | last post by:
I was once taught that if some integral value can never have negative values, it's a good style to use an 'unsigned' type for that: It's informative, self-documenting, and you are not wasting half...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.