from double to single precision

조회 수: 51 (최근 30일)
Beaya
Beaya 2013년 10월 27일
댓글: Azzi Abdelmalek 2013년 10월 27일
I want to calcute this equation x= 3.0*(4.0/3.0-1.0)-1.0 but using single precision instead of double. How do I do switch to single?

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 10월 27일
  댓글 수: 3
Azzi Abdelmalek
Azzi Abdelmalek 2013년 10월 27일
x = 1 - 3*(4/3 - 1)
a=single(x)
whos x a
and see the difference
Azzi Abdelmalek
Azzi Abdelmalek 2013년 10월 27일
To get the smallest double and single number
realmin('double')
realmin('single')

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by