On Sat, Jun 9, 2018 at 7:18 AM, Jeroen Demeyer <j.deme...@ugent.be> wrote:
> On 2018-06-09 11:12, Volker Braun wrote:
>>
>> But thats the thing about //, it is not natural wrt. embedding in a
>> larger ring. The whole point is that it throws away information, so you
>> cannot expect the diagram to commute:
>>
>> sage: ZZ(1) // ZZ(2)
>> 0
>> sage: QQ(1) // QQ(2)
>> 1/2
>
>
> True, I didn't know that. I would expect that both of these return 0.

That "QQ(1) // QQ(2)" returns 1/2 in Sage is surely a mistake.  It
might be my fault -- I have a vague memory of making this choice
(probably 14 years ago!).  Why it should be 0:

$ python3
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 2.5 // 3.5
0.0

(also, it's called "floor division"!)

Fortunately, for sage floats // is an error, rather than a wrong answer:

sage: 2.5 // 3.5
TypeError: unsupported operand parent(s) for //: 'Real Field with 53
bits of precision' and 'Real Field with 53 bits of precision'

>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.



-- 
William (http://wstein.org)

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to