1
$\begingroup$

I need to run a loop as

Table[expr,{i,imin,imax,di}]

where I want di to be as small as order of 2^(-100). However Mathematica 8.0 seems not to support me for such small di and generates a message "Iterator does not have appropriate bounds". What can be the solution?

$\endgroup$
1
  • $\begingroup$ s = 2^(-100); Table[i, {i, s, 5 s, s}] $\endgroup$ – Dr. belisarius Mar 8 '15 at 15:06
1
$\begingroup$

With integers and rational numbers for imin, imax, and di it should work.

di = 2^(-100)
imin = 1
imax = imin + 10 di

Table[Numerator[i] - Denominator[i], {i, imin, imax, di}]
{0, 1, 1, 3, 1, 5, 3, 7, 1, 9, 5}
$\endgroup$
2
  • $\begingroup$ may be i am making some logical error, while selecting imax for my particular problem. I try to resolve it in light of your suggestion and will update about details. Thank you $\endgroup$ – zenith Mar 8 '15 at 20:16
  • $\begingroup$ @zenith If (imax-imin)/di is unreasonably large, you'll get the "Iterator does not have appropriate bounds" error message. $\endgroup$ – Karsten 7. Mar 8 '15 at 20:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.