#17671: gcd and xgcd over fields, PID and UFD
-------------------------------------+-------------------------------------
       Reporter:  vdelecroix         |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.5
      Component:  basic arithmetic   |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Vincent Delecroix  |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/vdelecroix/17671                 |  c6db5f832b23d29026019de5306472a25e591279
   Dependencies:  #17673, #17675     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by bruno):

 Replying to [comment:22 vdelecroix]:
 > Why? Would you like it to be nice only over ZZ and not over QQ? And this
 is where it becomes impossible.

 First of all, your current solution is mathematically perfectly correct
 and I am quite fine with it. This said, let me expose the reasons of my
 suggestion.

 With my suggestion, "integral floating point numbers" are treated
 differently than other floating point numbers. Reasons:
 1. The `gcd` function coincide with the mathematical GCD function for
 integers only;
 2. Every floating point number can be seen as a rational, while not every
 floating point number can be seen as an integer.

 Also, `RR` and `QQ` are treated differently. Reasons:
 1. For inputs in `QQ`, we know that they are rational numbers, so we
 deviate from the mathematical definition to give a more meaningful answer
 and the definition we use "lives" in `QQ`;
 2. For inputs in `RR` that are "integral", we make an assumption (the
 floating point numbers we have at hand represent integers) and then use
 the standard mathematical definition;
 3. For inputs in `RR` that are not "integral", not returning `1.0000000`
 requires to make an assumption AND to deviate from the mathematical
 definition: that is, we would need to "move" from `RR` to `QQ` and then to
 use a non-standard definition.

 Finally, if a user asks for the GCD of two "integral floating point
 numbers", I have no difficulty to understand what s/he means (since the
 GCD of the integers they represent is a well-defined mathematical
 function). It is much more difficult to me to interpret the will of a user
 that asks for the GCD of two "rational floating point numbers", and this
 (also) justifies to treat differently the two situations.


 > Anyway mixing algebraic functions (like gcd) with floating point number
 is often a bad idea. So at least the proposed implementation tells you
 that something is wrong.

 I agree with that.

--
Ticket URL: <http://trac.sagemath.org/ticket/17671#comment:23>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" 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-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to