Robert Bradshaw wrote:
>
> 
> Technically, your matrix does not contain integer multiples of 0.1, it  
> contains approximations to integer multiples of 0.1, represented base  
> 2, truncated to 53 bits of precision.
> 
> sage: (0.1).exact_rational()
> 3602879701896397/36028797018963968
> 
> As you pointed out, you could do this over the rationals (where they  
> are actual integer multiples of 0.1) and it works fine. Doing it with  
> floating point numbers introduces rounding error, whence the  
> discrepancy. I would highly recommend
> 
> http://docs.sun.com/source/806-3568/ncg_goldberg.html
> 
> at least the first couple of sections.
> 

So when I'm done reading that 76-page document, I'll be able to do my 
linear algebra homework? I happen to have read it before, but it's an 
absurd thing to expect of end users.

Furthermore, my knowledge of floating point arithmetic in no way lead me 
to believe that SAGE would use it in lieu of the alternatives.


> It's messy the instant you type it in with decimal points

Not the end user's fault.


> it starts using floating point numbers internally.

I didn't tell it to do that.


> In your case I would recommend staying away from linear algebra over  
> inexact fields (like the reals) and do everything exactly until you  
> have a good sense of how rounding errors can be controlled, especially  
> if you're dealing with possibly singular matrices (which are ill  
> conditioned as indicated above). If you want exact answers, work over  
> an exact ring, and the (well known) issues of rounding errors won't  
> bite you like this.
>

Ok, but (assuming it can be done) how do you propose I convert my 
problem to an exact field? By hand? If only there were some sort of 
program...


> Eventually, using floating point, they're going to give incorrect  
> results. It's unclear whether its better to have consistent failure  
> right away, or work for some simple cases but give bad results later on.

This is one argument I can understand. If it's not possible to perform a 
calculation exactly, and the user hasn't specified that he or she would 
accept an approximation, SAGE should emit a warning, preferably 
accompanied by blinking Christmas lights and/or sirens.

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to