By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,171 Members | 1,020 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,171 IT Pros & Developers. It's quick & easy.

Conversion from long/long double to binary

P: 2
How can I convert numbers input as long/long double data type to binary in C/C++???

The program is in 2 parts. First teh program has to change inputs from long(32 bits) to binary and then show the result. Secondly change input from long double(80 bits??) to binary. The codes should be preferably in C++ but maybe in C too its ok.
Feb 21 '07 #1
Share this Question
Share on Google+
2 Replies


Expert 100+
P: 1,510
How can I convert numbers input as long/long double data type to binary in C/C++???

The program is in 2 parts. First teh program has to change inputs from long(32 bits) to binary and then show the result. Secondly change input from long double(80 bits??) to binary. The codes should be preferably in C++ but maybe in C too its ok.
not sure what you want do do - when data is read into the computer e.g. using scanf() in C or cin in C++, it is converted into the internal binary representation, see
http://en.wikipedia.org/wiki/Binary_numeral_system

do you want to print a double in binary, e.g. integer 5 as a 8 bit binary number is 00000101?
Feb 21 '07 #2

P: 2
not sure what you want do do - when data is read into the computer e.g. using scanf() in C or cin in C++, it is converted into the internal binary representation, see
http://en.wikipedia.org/wiki/Binary_numeral_system

do you want to print a double in binary, e.g. integer 5 as a 8 bit binary number is 00000101?
Yeah I want to print a long/long double in binary. for instance. I input a number 2,115,000,000 (long data type). How can I convert it to binary?
Feb 21 '07 #3

Post your reply

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