how to store matlab results in long precision
Show older comments
I am working with long precision values... after performing arithmetic division operation matlab is giving the rounded up result but i need to store the exact long precision value..
Answers (1)
Sean de Wolski
on 6 May 2011
as long as
class(your_result)
is 'double' it is long.
4 Comments
Basanta
on 6 May 2011
Sean de Wolski
on 6 May 2011
MATLAB uses long (ieee 754 double precision floating point (64 bits)) to begin with. Unless your data is something else, IT IS LONG. It may not be displaying all of the digits, but they're there.
To visualize:
format long
disp(your_result)
And use class() as above to verify
Matt Tearle
on 6 May 2011
or use something like fprintf('%16.13f',x) to see the result to whatever precision you want.
Basanta
on 7 May 2011
Categories
Find more on Logical 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!