from double to single precision
178 views (last 30 days)
Show older comments
Beaya
on 27 Oct 2013
Commented: Azzi Abdelmalek
on 27 Oct 2013
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?
0 Comments
Accepted Answer
Azzi Abdelmalek
on 27 Oct 2013
single(x)
3 Comments
Azzi Abdelmalek
on 27 Oct 2013
x = 1 - 3*(4/3 - 1)
a=single(x)
whos x a
and see the difference
Azzi Abdelmalek
on 27 Oct 2013
To get the smallest double and single number
realmin('double')
realmin('single')
More Answers (0)
See Also
Categories
Find more on Numbers and Precision in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!