简体   繁体   English

在matlab中计算科学数的尾数和指数

[英]calculate mantissa and exponent of scientific number in matlab

I want to find mantissa and exponent of a number in mat lab.我想在 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例如,当数字为 0.0005 时,此函数为尾数返回 5,为指数返回 -4

thank you谢谢你

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;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM