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!