> snip
>
> > [n for n in range(0,10) if is_Integer(n)]
>
> You are doing this from the command line, yes?
I am doing this in the notebook()
-Nirmal
--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this g
> [n for n in range(0,10) if is_Integer(n+1)]
snip
> [n for n in range(0,10) if is_Integer(n)]
You are doing this from the command line, yes? The first is getting
preparsed, so that 1 is not a python int, it is a sage Integer:
sage: preparse('[n for n in range(0,10) if is_Integer(n+1)]')
'[
> How could you not notice? If I do is_Integer I get a big DeprecationWarning:
> Does your Sage not do that?
The reason I did not notice it is that is_Integer() was in the body of
a main loop and no warnings were printed.
For example,
[n for n in range(0,10) if is_Integer(n+1)]
returns
[0,
> How could you not notice? If I do is_Integer I get a big DeprecationWarning:
> Does your Sage not do that?
The reason I did not notice it is that is_Integer() was in the body of
a main loop and no warnings were printed.
For example,
[n for n in range(0,10) if is_Integer(n+1)]
returns
[0,
On Fri, Apr 24, 2009 at 8:42 PM, Robert Bradshaw
wrote:
>
> On Apr 24, 2009, at 8:24 PM, Nick Alexander wrote:
>
>>
>>> Another option is
>>>
>>> sage: 3/2 + 1/2 in ZZ
>>> True
>>> sage: 3/2 + 1/3 in ZZ
>>> False
>>
>> I just ran into the "True in ZZ" returns True thing again. How do I
>> check
On Apr 24, 2009, at 8:24 PM, Nick Alexander wrote:
>
>> Another option is
>>
>> sage: 3/2 + 1/2 in ZZ
>> True
>> sage: 3/2 + 1/3 in ZZ
>> False
>
> I just ran into the "True in ZZ" returns True thing again. How do I
> check to see if I passed an option or "True"?
You can do "x is True"
- Rober
> Another option is
>
> sage: 3/2 + 1/2 in ZZ
> True
> sage: 3/2 + 1/3 in ZZ
> False
I just ran into the "True in ZZ" returns True thing again. How do I
check to see if I passed an option or "True"?
Nick
--~--~-~--~~~---~--~~
To post to this group, send email
On Fri, Apr 24, 2009 at 10:59 AM, nirmal wrote:
>
> Thanks for all the helpful suggestions. I did not realize that
> is_Integer() was deprecated.
How could you not notice? If I do is_Integer I get a big DeprecationWarning:
sage: is_Integer(3)
/Users/wstein/.sage/temp/D_69_91_158_76.dhcp4.wash
Thanks for all the helpful suggestions. I did not realize that
is_Integer() was deprecated.
On Apr 22, 2:00 am, John Cremona wrote:
> This is precisely why we deprecated all the is_*() functions for end-user use:
>
> --
> | Sage
This is precisely why we deprecated all the is_*() functions for end-user use:
--
| Sage Version 3.4.1.rc4, Release Date: 2009-04-19 |
| Type notebook() for the GUI, and license() for information.|
-
On Apr 21, 2009, at 10:54 PM, Craig Citro wrote:
>> In module sage.rings.integer
>>
>> is_Integer(3/2+1/2)
>>
>> returns
>>
>> False The expected output should be True as 3/2+1/2 = 2.
>>
>> I was planning to use this function to check if the result of
>> division
>> is a whole number.
>>
>
>
> In module sage.rings.integer
>
> is_Integer(3/2+1/2)
>
> returns
>
> False The expected output should be True as 3/2+1/2 = 2.
>
> I was planning to use this function to check if the result of division
> is a whole number.
>
You could also use the is_integral method of rational numbers:
sage:
12 matches
Mail list logo