How to calculate mantissa of 0.5
8 次查看(过去 30 天)
显示 更早的评论
Is there any function to calculate the mantissa of 0.8 by matlab?
0 个评论
采纳的回答
Star Strider
2021-9-17
I created a little utility function to calculate the mantissa and exponent of a floating-point number a while ago, for my own use.
Trying it here —
expstr = @(x) [x(:).*10.^ceil(-log10(abs(x(:)+(x==0)))) floor(log10(abs(x(:)+(x==0))))];
expstr([0.5; 0.8])
The mantissa is the first element and the exponent is the second element in each row.
.
2 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!