[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #32924] lcm does not warn when losing precisio

From: Jordi Gutiérrez Hermoso
Subject: [Octave-bug-tracker] [bug #32924] lcm does not warn when losing precision
Date: Tue, 29 Mar 2011 01:40:22 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110109 Riverdragon/3.6.13 (like Firefox/3.6.13)

Update of bug #32924 (project octave):

                Severity:              3 - Normal => 1 - Wish               
                Priority:              5 - Normal => 3 - Low                
              Item Group:        Incorrect Result => Feature Request        
                  Status:                 Invalid => Confirmed              
             Open/Closed:                  Closed => Open                   
                 Release:                   3.2.4 => dev                    
                 Summary: lcm yields wrong results => lcm does not warn when
losing precision


Follow-up Comment #9:

I don't see a way to remove comments in Savannah, only to flag them as spam.

I'm going to be a little stubborn about this. But I'll reopen this bug and
make it wishlist for a warning, plus retitling this bug. I don't have any
particular inclination myself to write a warning about this. It seems a bit
like adding a warning for the other examples I gave. Floats have limited
precision. That's all there is to it. I could give examples of things being
too large and losing precision instead of being too small and also losing
precision. Note that there are many other locations in Octave where doubles
are used for what should be integers (bincoeff and some permutation functions
come to mind), so if you really want to warn for all of these, perhaps you
should look into functions like xisinteger in liboctave/lo-mappers.h and put
the warnings in there, or create a new function that checks if a double is too
large to be an integer and warn accordingly.

If you write a patch to add a warning to src/DLD-FUNCTIONS/gcd.cc, I'll apply
it. Make sure your check doesn't slow down the function considerably. Also
note that the types of arguments to gcd and lcm have changed in the dev
sources and vector arguments have are now interpreted for elementwise gcd and
lcm, and you need at least two arguments. So you would have to rewrite your
test case as lcm(25,26,27, ... , 52), or patch the functions again to recover
that kind of passing the arguments.

This really seems like unnecessary effort to me. Octave is a not a number
theoretical environment. These number theoretical functions should be kept
simple and used sparingly, and if you need heavy number theory lifting, use
Pari or Sage. If you decide to proceed with this effort, however, I will not
dismiss it and apply your patch.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]