How to calculate mantissa of 0.5
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Osamah Alayafi
am 17 Sep. 2021
Kommentiert: Star Strider
am 17 Sep. 2021
Is there any function to calculate the mantissa of 0.8 by matlab?
0 Kommentare
Akzeptierte Antwort
Star Strider
am 17 Sep. 2021
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!