log2 function has incorrect help text

조회 수: 14 (최근 30일)
Michael Wagner
Michael Wagner 2017년 2월 21일
댓글: Steven Lord 2017년 2월 21일
The following help text is incorrect: [F,E] = log2(X) for each element of the real array X, returns an array F of real numbers, usually in the range 0.5 <= abs(F) < 1, and an array E of integers, so that X = F .* 2.^E.
In fact there is only ONE array F and ONE array E for a real array X, such that for each element X(i), X(i) = F(i) .* 2.^E(i).
  댓글 수: 1
Steven Lord
Steven Lord 2017년 2월 21일
Your statement is not quite true. Consider the case where X is Inf, -Inf, or NaN. I don't have a reference link for the ANSI C frexp function cited in the Tips section of the log2 documentation page but the C++ std::frexp() function says that for nonfinite values of arg, the nonfinite value is returned by std::frexp and "an unspecified value is stored in *exp".
The documentation should probably list what this function returns for non-finite values like it documents the behavior for X = 0. I've asked the documentation staff to take advantage of your feedback to make this change.

댓글을 달려면 로그인하십시오.

채택된 답변

Adam
Adam 2017년 2월 21일
There is a 'Was this topic helpful?' question at the bottom of each help page. Click 'No' on that and you get a chance to give feedback which Mathworks staff will generally respond to fairly quickly.
  댓글 수: 1
Michael Wagner
Michael Wagner 2017년 2월 21일
Thanks, Adam. I have provided feedback as you suggested. Michael

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Entering Commands에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by