With 6.3.beta5 I get sage: Q = DiagonalQuadraticForm(ZZ,[1,4,4]) sage: Q.is_locally_represented_number(42) True sage: Q.is_locally_represented_number(int(42)) True
which suggests that this has been fixed. John On 1 July 2014 03:54, Edna Jones <jonese...@gmail.com> wrote: > sage: Q = DiagonalQuadraticForm(ZZ,[1,4,4]) > sage: for j in range(42,43): > ....: print(j, Q.is_locally_represented_number(j)) # should print (42, > False) but prints (42, True) > ....: > (42, True) > > The above code prints (42, True) using Sage, version 6.2. I should state > that the above code prints the correct output, i.e. (42, False), if > IntegerRange is used instead of range. To see why the code should print (42, > False), mod the expression generated by the quadratic form by 4. I believe > that is_locally_represented_number() returns the wrong value because I'm > passing a Python int to it instead of a Sage Integer. However, the > documentation for is_locally_represented_number() does not explicitly state > that a Python int cannot be passed to it. Clearly, the function > is_locally_represented_number() does not raise an error when a Python int is > passed to it; the function just outputs ridiculous values. > > -- > 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 http://groups.google.com/group/sage-support. > For more options, visit https://groups.google.com/d/optout. -- 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 http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.