Ben Crazed Up Euden
Ben Crazed Up Euden

Reputation: 353

Trying to understand Floating point arithmetic

So i'm trying to understand floating point arithmetic with the mantissas and exponents etc but finding it confusing.

I've been given a practice question but do not know which answer is correct:

Assume you have a 5 digit mantissa m, 2 digit exponent e and a bias of 45 ignoring signs. what number can be represented by: m= 03456 with exponent e=41?

My initial guess was this is 3456*10^(41-45) which is 3.456 but do i remove the 0 or keep it in which case its 0.3456?

any help clearing up this confusion would be appreciated.

Upvotes: 0

Views: 131

Answers (1)

TonyK
TonyK

Reputation: 17114

A well-formed floating-point number would generally be expected to have a non-zero leading digit (unless it was denormalised, which this isn't because the biased exponent is non-zero). So your mantissa 03456 is dubious.

I think it's a bad idea to introduce floating-point numbers in base 10, because it introduces complications that aren't present in binary. First learn binary, then floating-point.

Upvotes: 2

Related Questions