3

I want to find mantissa and exponent of a number in mat lab. Is there a function or way to calculate them?

for example when the number is 0.0005 this function returns 5 for mantissa and -4 for exponent

thank you

A.Mani
  • 71
  • 1
  • 9

1 Answers1

3

The exponent can be given by :

x= 0.0005;
exponent=floor(log10(x));

and the coefficient (I refuse to call it mantissa, because it disagrees with common definition).

coeff=x/10^exponent;
GameOfThrows
  • 4,510
  • 2
  • 27
  • 44