Dealing with very high number like 2^1024 bit
Show older comments
I work with very high number like 2^1024 and bigger when I try to compute this function MATLAB GIVE Inf. How can I over come this problem.
Accepted Answer
More Answers (2)
michio
on 1 Sep 2016
0 votes
One way to overcome the issue is to use the Symbolic Math Toolbox in MATLAB to evaluate expressions with more floating-point precision than double precision.
Steven Lord
on 1 Sep 2016
Use Symbolic Math Toolbox.
two = sym(2);
two1024 = two^1024
Note that the following will NOT work, as 2^1024 will be computed in double precision (and overflow to Inf) then that Inf will be converted into a symbolic value.
two1024 = sym(2^1024)
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!