フィルターのクリア

The mantissa of a floating point number???

34 ビュー (過去 30 日間)
Joe
Joe 2013 年 3 月 17 日
コメント済み: Sukshith Shetty 2021 年 8 月 8 日
What is the mantissa of a floating point number? How would you find it?
  2 件のコメント
Stephen23
Stephen23 2016 年 1 月 15 日
Note that in mathematics the mantissa is actually the fractional part of a common logarithm:
while significand is the correct term for the significant digits of a floating point number:
Sukshith Shetty
Sukshith Shetty 2021 年 8 月 8 日
how do i find mantissa and exponent of a given number?

サインインしてコメントする。

採用された回答

the cyclist
the cyclist 2013 年 3 月 17 日
編集済み: the cyclist 2013 年 3 月 17 日
It's the fractional part of a real number.
In MATLAB, you can calculate the mantissa of x as
>> x - floor(x)
There are lots of places to read about floating point numbers and their representation. Here's one:
Please see James Tursa's answer for a cautionary note about the two different definitions of mantissa! Since you asked about binary form, I expect you mean the one from the Cleve Moler article, not the Mathworld article definition (or the formula I gave).
  2 件のコメント
Joe
Joe 2013 年 3 月 17 日
How would I convert the mantissa to binary form?
Walter Roberson
Walter Roberson 2013 年 3 月 17 日

サインインしてコメントする。

その他の回答 (2 件)

James Tursa
James Tursa 2013 年 3 月 17 日
編集済み: James Tursa 2013 年 3 月 17 日
A word or caution here. The mantissa referred to in the mathworld link above is NOT the same as the mantissa referred to in the Cleve Moler link. The Cleve Moler link refers to a number written in binary exponential notation as (1 + f) * 2^e, and the f here is the "mantissa" or fractional part (the part that is physically represented in the IEEE floating point format). This of course will not match an expression like f = x - floor(x) for an arbitrary x. A simple example would be 0.5. In the Cleve Moler link you would get f = 0, but in the mathworld link you would get f = 0.5. So which one should you use? Depends on your needs. If you are trying to dissect a specific floating point bit pattern on your machine, then typically the Cleve Moler link formula is what is usually intended. You can get at these values with the MATLAB function [F,E] = log2(X).
I would also add that the Cleve Moler link formula only applies to floating point bit patterns that use a hidden leading bit normalization scheme (like IEEE). Although most (all?) modern computers do this, it is not true in general of all computers (some actually have the leading mantissa bit present in the floating point bit pattern).

Sunjatun Ahmed Runa
Sunjatun Ahmed Runa 2021 年 6 月 1 日
>> x = sin(60/180*pi)
x =
0.8660
>> y = xˆ2
y =
0.7500
>> exp(log(4))

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by