answersLogoWhite

0


Best Answer

Here is an example: 3.1416, which is pi rounded to the nearest ten thousandth, converted to binary:

The highest power of 2 in the number is 2^1 (2), so we start with 1-. Subtracting 2 leaves 1.1416. The next power of 2 is 2^0 (1). The left over difference is greater than 1, so we have 11. so far. Subtracting 1 from the previous difference leaves 0.1416. The next power of 2 is 2^(-1), or 1/2. Our difference is less than 1/2, so our next bit (short for binary digit) is 0. So far we have 11.0. The next power of 2 is 2^(-2), or 1/4. Our difference is less than a quarter, so we have 11.00. Next is 2^(-3), or 1/8. Our difference is greater than an eighth, so we have 11.001 so far, and we subtract 0.125 from 0.1416, leaving 0.0166. That's less than 1/16, so we have 11.0010. It's also less than 1/32, so we're up to 11.00100. It's greater than 1/64, so we have 11.001001. 0.0166 - 0.015625 = 0.000975. That's less than 1/128 (so we have 11.0010010), it's less than 1/256 (11.00100100), it's less than 1/512 (11.001001000), it's less than 1/1024 (11.0010010000), but it's greater than 1/2048 (taking us to 11.00100100001). Subtracting 0.00048828125 leaves 0.00048671875. Subtracting 1/4096 and 1/8192 takes us to our original precision (one ten thousandth) and brings our number to 11.0010010000111. Since the next bit is also a 1, I will round the number up to 11.0010010001000. And there you have it: binary pi rounded to the 8192nds place.

Going from binary to decimal is easy: you just add together the powers of 2 for every place in the number that has a 1. There are 1's in the 2s place, in the 1s place, in the 8ths place, in the 64ths place and in the 1024ths place. 2 + 1 + 1/8 + 1/64 + 1/1024 = slightly more than 3.1416 (because we rounded up).

User Avatar

Wiki User

8y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How can you convert numeric data between different number systems using a floating point?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you convert your income in to numeric value?

numeric value for monthly income


How you convert 130000 in numeric numbers?

(CXXX)


What is the numeric value of 1200 mile and how is it written?

"Numerical value" simply refers to the number, in this case, 1200. Of course, if you convert it to a different unit you'll get a different numerical value - a different number.


What is finite precision arithmetic?

Finite precision arithmetic, solve numeric errors by using the floating point.


How do you calculate word problems?

You convert the word problem into a numeric problem and then calculate.


What are differences between data types numeric and non numeric?

Numeric data are data that can be quantify. i.e age, e.t.c While Non-numeric data are data that cannot be quantify but can be categorise. Such as colour, name e.t.c


How do you write three tenths of a thousandths?

convert word to numeric value three tenths of a thousandth


What is the difference between numeric data and non-numeric data?

Numeric data are numbers (like age, cost, etc.), while non-numeric data are not numbers (like name, address, etc.).


What is difference between '1' and 1 in c plus plus?

1 is an integral integer type with the numeric value 1. '1' is an integral character type with the numeric value 49. That is, ASCII character 49 returns the symbol '1'. To convert an ASCII character in the range '0' to '9' to its integral numeric value, subtract character '0' from the character. ASCII character '0' has the numeric value 48, thus '1' - '0' = 49 - 48 = 1. To convert a numeric value in the range 0 to 9 to its ASCII character equivalent, add character '0' to the value. Thus 1 + '0' = 1 + 48 = 49 = '1'.


What is the command to convert characters in to numeric in Microsoft visual fox pro?

VAL(CharVariable) Hope this helps


What the difference between a geometric and a numeric constraint?

Nothing


How do you convert numeric value into alpha value in c plus plus programming language?

use the _itoa function