Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following as the first step to a sequence.

x = 2 - GoldenRatio;
Ceiling[x + x^(1/2)]

It gets a precision exception. The value is correct, but I would like to prevent the exception. (If we subtract 0.000001 from x, everything is fine.)

Is there a way to limit the precision? For one step only?

Edit: the sequence where 2-GoldenRatio is the seed.

x = 2 - GoldenRatio; t = Table[(x = Ceiling[x + x^(1/2)]), {2000}];

If ceiling is removed the first step works fine. However, I need the ceiling for alternate steps.

Edit2: $0 < x \leq 2-\phi$ where $\phi$ is the golden ratio. $\textit{When x = 2 - $\phi$, the first step equals $1$}$.

share|improve this question
up vote 1 down vote accepted

Does this get you what you need:

x = N[2 - GoldenRatio]
Ceiling[x + x^(1/2)]


This doesn't get a precision exception.

This as per the update of your question also works without getting an error.

x = N[2 - GoldenRatio];
t = Table[(x = Ceiling[x + x^(1/2)]), {2000}];
share|improve this answer
That's the ticket! – Fred Kline Jul 10 '12 at 3:03

Perhaps you could make a value inexact:

x = 2` - GoldenRatio;
x + x^(1/2)

Or use FullSimplify:

x = 2 - GoldenRatio;
x + x^(1/2) // FullSimplify
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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