On Friday, March 16, 2018 at 7:29:30 PM UTC-7, A. Jorge Garcia wrote: > > Thanks! > > On Fri, Mar 16, 2018, 10:27 PM Andrey Novoseltsev <novo...@gmail.com > <javascript:>> wrote: > >> On Fri, Mar 16, 2018 at 4:18 PM, Jorge Garcia <calc...@gmail.com >> <javascript:>> wrote: >> > Dear Hive Mind: >> > >> > Why is there no Divide By Zero Error here: >> > >> http://sagecell.sagemath.org/?z=eJwljkELgkAUhO-C_2GiAtek1kuX2Eu4pBc3NjEqCqQ2E-QlpvX3cwuGd5jHzDdjZHGyw6BUZdgoFQXYx1JLa2WxRJTkSSSxPuAotYLUWumR64zRcDEJOecBtFhOA3QitHZpyLRFZ1BR03fDvdb9raISJLjrpKItqDReyNnq9Xh-vJTZkHkXdW9DjUcMvu__F2SIlNxhk-Tyt-UHH76usxUny_a9cMbnfLkgdiHcny1oICI9_8u37AuZcDtw&lang=sage >> > >> > But there is a Divide By Zero Error here (as expected): >> > >> http://sagecell.sagemath.org/?z=eJwlj0FLw0AQhe-B_IcnVcimQTeXXmQPtRnsXrJhG6q2WAh2GwtlGmKif9_dBoY5zJvvzZsZ6rXewNerMUWGNwK9V7SqsUSht7ogvHxgR9aArDX2Lo5m6KS6z6WUGaxaPGQYVB5HXcJChWma5HP5KBdPLA78_PN9_UuCJgLZOnZ9MzicuRsH378u4_HMLVjJOCpV33DrklyKiStvkPttLmOAgg3SNF2TJegahSGfW2_JP0FTPq_GUaX2t9XTtQf7Iyg_J79K_AMYbUA7&lang=sage >> > >> > Can someone please explain this to me? This came up in class and I was >> > looking for a "teachable moment" asking the students to fix the Divide >> By >> > Zero Error like this: >> > >> http://sagecell.sagemath.org/?z=eJwljkFrg0AUhO-C_2GKKbhW0t1LLmUvwddmLxq2EtKWBKTZWkGeYjX5-3XjbXgz37yJkJmDyQjbD3ySLUDWFhav5kjZQxhE6KVeKSllCqs3jylGrcKgj1lof01i9STXcvPM4swvf7_dLfae8GTt2A3V6NBwP43Ii3JW3-10abgGaxkGuR4qrl2sUiXFQud31F2rdvKoL0OSJDuyBFMiK-gdb-ZAKHe0bJ3dMNjrr3v0pxvA8xvkp6VvL_4B6uc8qg==&lang=sage >> > >> > Thanx, >> > AJG >> >> Someone probably can, but perhaps not on this list: it has something >> to do with 0^0 evaluating to 1 and I recall some earlier discussions >> about it. Forwarding to sage-support. >> > It may be related to this:
sage: 2/0 --------------------------------------------------------------------------- ZeroDivisionError Traceback (most recent call last) <ipython-input-72-38bb5ffd9469> in <module>() ----> 1 Integer(2)/Integer(0) /Users/palmieri/Desktop/Sage_stuff/sage_builds/VANILLA/sage-8.2.beta8/local/lib/python2.7/site-packages/sage/rings/integer.pyx in sage.rings.integer.Integer.__div__ (build/cythonized/sage/rings/integer.c:13231)() 1910 if type(left) is type(right): 1911 if mpz_sgn((<Integer>right).value) == 0: -> 1912 raise ZeroDivisionError("rational division by zero") 1913 x = <Rational> Rational.__new__(Rational) 1914 mpq_div_zz(x.value, (<Integer>left).value, (<Integer>right).value) ZeroDivisionError: rational division by zero sage: 2.0/0 +infinity I don't much like this behavior. Is the rationale that in inexact rings, division by zero is not a thing? -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at https://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.