Thanks for this trick.

2014-10-28 16:36 GMT+01:00 William Stein <[email protected]>:

> On Tue, Oct 28, 2014 at 8:19 AM, Christophe Bal <[email protected]>
> wrote:
> > Hello.
> >
> > I'm writing a french book about SageMathCloud and I'm looking for known
> > wrong results given by Sage due to floats calculations, or due to the
> method
> > used. Do you know such things ? My idea is to show to new user that a
> CAS or
> > a numerical tool is not Math God.
> >
> > For my part, I really like the following one. Try it, it is funny even
> if I
> > know what is is the reason of the unexpected result.
> >
> > --------------------------
> > u = 1.0/3
> >
> > for i in range(100):
> >     u = 4*u - 1
> >
> > print u
> > --------------------------
>
> This is a good motivation for RIF (real interval field), which tracks
> errors, e.g.,
>
>
> u = RIF(1/3)
>
> for i in range(100):
>     u = 4*u - 1
>
> print u
>
>
> The output is 0.?e44, which means no digits are known to be right.
>
> See [1].
>
> [1]
> https://cloud.sagemath.com/projects/4a5f0542-5873-4eed-a85c-a18c706e8bcd/files/support/2014-10-28-083459-funny-and-wrong.sagews
>
>
>
>
> --
> William Stein
> Professor of Mathematics
> University of Washington
> http://wstein.org
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to