nthroot(X, N) when X is inf
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
Star Strider
2012-6-23
Please post the code of the 'for' loop so we can understand how you create X. What is X?
回答(2 个)
Walter Roberson
2012-6-23
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 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!