0
$\begingroup$

I was assigned the following question:

List all numbers that can be represented exactly in a normalised floating- point number system with base 10, two digits in the fraction, and an exponent 0 ≤ e ≤ 2. How many are there in total (including zero)?

The bit in particular that confuses me is the 'base 10' aspect. After doing some research I found that a normalised floating-point number system is supposed to have a '1' before the decimal point and the rest afterwards but that only works for binary. Also, if I am supposed to list the numbers and this is in base 10, it would seem like a really large amount to list.

So it seems I need to answer the question in binary, but I am really confused about why 'base 10' is being mentioned.

Thanks

$\endgroup$
  • $\begingroup$ Don't forget the negative ones, too! $\endgroup$ – kimchi lover Oct 22 '18 at 2:55
0
$\begingroup$

Floating-point numbers in modern computers are almost exclusively one of a few types of IEEE-defined floating-point types that differ only in how many bits are used for each number.

But the concept of a floating-point representation is not limited to what the vast majority of actual applications are using. You're being asked a theoretical question about another kind of floating-point representation that could be used.

The "leading digit is always $1$" trick only works in binary, and therefore you cannot use it in base ten. There is a bit of ambiguity in the question regarding whether "two digits in the fraction" means they want numbers like $2.34 \times 10^1$ or like $0.34 \times 10^1.$ In the absence of any other indication, if I had to guess, I would guess they mean $0.34 \times 10^1$ just because the other way is ten times as many numbers to write. But if you can ask the person who assigned this question, I would recommend you do.

Even if we only use two fractional digits (like $0.34 \times 10^1$), there are still a few hundred possible numbers. If you really literally must list them all, perhaps you can get them printed out by computer. A simple spreadsheet can do the job. But I suspect that only only need to list enough of them in a pattern so that it is clear how you would fill in the missing numbers (and how many there would be), much the way that if I write $1,2,3,4,\ldots,59,60$ you can see I have in mind the first sixty positive integers. Again, that is something to ask the person who assigned this if you can.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.