nthroot(X, N) when X is inf
3 views (last 30 days)
Show older comments
Id like to take the 4537-th root of a number X.
The number X is too large for matlab to handle so it says Inf.
The number X comes from a for-loop where i go from i=1:4537 and X gets larger and larger.
Can i somehow use the factors of 4537
factor(4537)
ans =
13 349
and take the roots of X in intervalls so it wont reach inf, or something?
1 Comment
Star Strider
on 23 Jun 2012
Please post the code of the 'for' loop so we can understand how you create X. What is X?
Answers (2)
Walter Roberson
on 23 Jun 2012
A real root of a number can only be larger than the number if the number is between -1 and +1, and in that range the root itself is limited to -1 to +1. The only way for the 4537'th root of a number to be infinity is if the number itself is infinity, and if that is the case then factoring for roots is not going to produce anything other than infinity.
Factoring can only help if you apply it at the stage of constructing the number whose root is being taken so that it does not reach overflow (represented by infinity.)
Factoring itself is probably not going to work because you are going to run into prime numbers. You should probably instead be looking at log representation.
0 Comments
See Also
Categories
Find more on Arithmetic Operations 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!