Talk:Continued fraction/Arithmetic/G(matrix ng, continued fraction n1, continued fraction n2): Difference between revisions

Content added Content deleted
(→‎Non-unique solutions: One of the more recently standardized areas it seems)
Line 17: Line 17:
::::-151/77 is -1 remainder -74 (not -2 remainder 3) and is [-1;-1,-24,-1,-2] or -[1;1,24,1,2] (not [-2;25,1,2])
::::-151/77 is -1 remainder -74 (not -2 remainder 3) and is [-1;-1,-24,-1,-2] or -[1;1,24,1,2] (not [-2;25,1,2])
:::the other definition works, but is it pretty or pretty bizzare?--[[User:Nigel Galloway|Nigel Galloway]] 13:27, 12 March 2013 (UTC)
:::the other definition works, but is it pretty or pretty bizzare?--[[User:Nigel Galloway|Nigel Galloway]] 13:27, 12 March 2013 (UTC)

:::: My point is that there is no guarantee that a sequence is actually unique. The fundamental issue is that there are two ways of solving the integer division problem when extending into producing negative results: one states that the sign is an indication of the sign of the inputs, and the other states that division is about partitioning the number line and indicating which partition. (Alternatively, one definition of integer division uses round-to-zero and the other uses round-down rules when converting from a non-integer intermediate result; I've never heard of a universally-accepted definition of which of those two is right.) As long as <math>a = b\times (a/b) + (a\%b)</math> is true, mathematical sanity is maintained. Different languages have different rounding rules. (BTW, [[C]] prior to C99 has implementation-defined rounding rules[http://stackoverflow.com/q/3602827/301832]. With [[C++]], I think C++11 is the first revision of the standard to define this clearly[http://stackoverflow.com/q/319880/301832].) –[[User:Dkf|Donal Fellows]] 15:24, 12 March 2013 (UTC)