On Tue, Nov 4, 2008 at 3:05 PM, Bill Hart <[EMAIL PROTECTED]> wrote: > > Right, I typed it incorrectly. But if I type R.<t> = RDF['t'] the > result is the same. > Bill.
Yes, that's true. I just jumped on that one problem, since it initially prevented me from executing the rest of the code. Then when I went on to answer you real question, I stopped, since like 2 or 3 other people already had. Did you get that example from some canonical "bad numerical analysis examples" book or something? Floating point numbers are like piles of sand and arithmetic with them is like moving them around. The more you move them around the more dirt you get in them. William > > On 4 Nov, 03:43, "William Stein" <[EMAIL PROTECTED]> wrote: >> On Mon, Nov 3, 2008 at 7:06 PM, Bill Hart <[EMAIL PROTECTED]> wrote: >> >> > sage: R.<x>=RDF['t'] >> >> This first line is wrong. It should be >> >> R.<t> = RDF[] >> >> or >> >> R.<t> = PolynomialRing(RDF) >> >> or >> >> R.<t> = RDF['t'] >> >> As is, you've made the polynomial ring that prints its >> variable as t but is referred to as x. Here's something similar. >> >> age: R.<x> = QQ['t'] >> sage: x >> t >> >> Who knows what you defined the t to be that you're using above? >> I don't. >> >> William >> >> > sage: s=1.0e1*t^3+1.0e-100*t^2+1.01234e-100*t+1.0e1 >> > sage: u=1.0e1*t^3-1.0e1*t^2+1.0e1*t-1.0e1 >> > sage: s*u >> > 100.0*t^6 - 100.0*t^5 + 100.0*t^4 - 100.0*t^2 + 100.0*t - 100.0 >> >> > What happened to the t^3 term? >> >> > Bill. >> >> -- >> William Stein >> Associate Professor of Mathematics >> University of Washingtonhttp://wstein.org > > > -- William Stein Associate Professor of Mathematics University of Washington http://wstein.org --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---