Smallest positive number in MATLAB

조회 수: 163 (최근 30일)
Dyuman Joshi
Dyuman Joshi 2021년 4월 27일
댓글: Dyuman Joshi 2021년 4월 30일
I recently stumbled upon a question on Cody (#1874), which asked the user to input the smallest in MATLAB.
As per my knowledge, realmin was supposed to return the smallest number in MATLAB, however that number is the smallest normalized floating point number. According to this thread of Stack overflow, it says eps(0) returns the smallest denormal number available in MATLAB.
However, my question is how eps(0) is denormal?
> realmin returns 2.2251e-308, where as eps(0) returns 4.9407e-324

채택된 답변

Stephen23
Stephen23 2021년 4월 27일
편집: Stephen23 2021년 4월 27일
eps(0) returns the smallest positive non-zero floating point number, which is denormal:
format hex
eps(0)
ans =
0000000000000001
Normal and denormal floating point numbers are explained here:
From the main architect of IEEE 754 (the term "gradual underflow" refers to denormal numbers):
  댓글 수: 2
Dyuman Joshi
Dyuman Joshi 2021년 4월 27일
Thanks for all the resources, @Stephen Cobeldick. I'll try to go through them all.
Dyuman Joshi
Dyuman Joshi 2021년 4월 30일
Apparently I misunderstood the definition of a denormal (base 10 instead of base 2). Thank you for your answer and the links!

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by