ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 23 Apr 2016 06:29:53 +0200Assumption that n is positive integerhttps://ask.sagemath.org/question/33182/assumption-that-n-is-positive-integer/ I wrote
assume(n, 'integer')
assume(n>0)
assumptions()
Sage gave back
[n is integer, n > 0]
Yet the command
n.is_integer()
returned false. Also, the assumptions were not used in later computations. For example
gamma(-n)
did not return infinity.
Fri, 22 Apr 2016 11:52:02 +0200https://ask.sagemath.org/question/33182/assumption-that-n-is-positive-integer/Comment by paulmasson for <p>I wrote</p>
<pre><code>assume(n, 'integer')
assume(n>0)
assumptions()
</code></pre>
<p>Sage gave back</p>
<pre><code>[n is integer, n > 0]
</code></pre>
<p>Yet the command</p>
<pre><code>n.is_integer()
</code></pre>
<p>returned false. Also, the assumptions were not used in later computations. For example</p>
<pre><code>gamma(-n)
</code></pre>
<p>did not return infinity.</p>
https://ask.sagemath.org/question/33182/assumption-that-n-is-positive-integer/?comment=33202#post-id-33202Take a look at this question:
http://ask.sagemath.org/question/9465/check-that-variable-is-integer/Sat, 23 Apr 2016 06:29:53 +0200https://ask.sagemath.org/question/33182/assumption-that-n-is-positive-integer/?comment=33202#post-id-33202