Re: [sage-support] Difference between sage and pyhton calculations

2010-04-06 Thread Robert Bradshaw
On Apr 5, 2010, at 9:44 PM, William Stein wrote: On Mon, Apr 5, 2010 at 9:12 PM, Michael Welsh yom...@yomcat.geek.nz wrote: On 6/04/2010, at 3:56 PM, Eugene Goldberg wrote: Hello! Here is my pyhtons results: python Python 2.6.5 (r265:79063, Mar 23 2010, 04:49:54) [GCC 4.4.3] on linux2

[sage-support] Re: Difference between sage and pyhton calculations

2010-04-06 Thread Alec Mihailovs
On Apr 5, 11:56 pm, Eugene Goldberg omegat...@gmail.com wrote: Python 2.6.5 (r265:79063, Mar 23 2010, 04:49:54) 6e-6 % 10e-6 6.0002e-06 Sage Version 4.3.5, Release Date: 2010-03-28 sage: 6e-6 % 10e-6 -4.00e-6 I'm sure sage is wrong.. :( As William Stein said,

[sage-support] Re: Difference between sage and pyhton calculations

2010-04-06 Thread Alec Mihailovs
On Apr 6, 2:00 am, Robert Bradshaw rober...@math.washington.edu wrote: I would be in favor of following Python's conventions here--they at   least seem more natural to me (after all, % is related to floor   division not round division. :) Also, currently 2==2., 3==3., but 2%3 is 2 and 2.%3.

[sage-support] Re: groebner fan with

2010-04-06 Thread Andrea Gobbi
Thank you for the answer...I have some question: -I have gf=I.groebner_fan(); where I is a 0-dimentional ideal. Now gf has the function gf.weight_vectors(); This returns the weight vectors corresponding to the reduced Groebner bases. I try to call polyedralfan() but it raises an error...maybe

Re: [sage-support] Difference between sage and pyhton calculations

2010-04-06 Thread Paul Zimmermann
sage Sage Version 4.3.5, Release Date: 2010-03-28 sage: 1+1 2 sage: 6e-6 % 10e-6 -4.00e-6 I'm sure sage is wrong.. :( They're both the same... No they aren't. If you type sage: s = 6e-6 sage: s.__mod__?? then you can read the documentation for Sage's

Re: [sage-support] Difference between sage and pyhton calculations

2010-04-06 Thread Paul Zimmermann
If one wants to have the same answer as Python does (always nonnegative), then function math.fmod can be used. For example, sage: from math import fmod sage: fmod(6e-6,10e-6) 6.0002e-06 first Python does not always give a nonnegative result: (6e-6) % (-10e-6)

Re: [sage-support] Difference between sage and pyhton calculations

2010-04-06 Thread Robert Bradshaw
On Apr 6, 2010, at 12:17 AM, Paul Zimmermann wrote: If one wants to have the same answer as Python does (always nonnegative), then function math.fmod can be used. For example, sage: from math import fmod sage: fmod(6e-6,10e-6) 6.0002e-06 first Python does not always give a

[sage-support] Re: groebner fan with

2010-04-06 Thread Marshall Hampton
Can you post the system you are working with? Or if its very large, post a link to a file? I don't work over finite fields myself, so the current implementation is probably very biased towards QQ. It would help me to see a real life example. Thanks, Marshall Hampton On Apr 6, 2:04 am, Andrea

[sage-support] Can't solve equation with square roots...

2010-04-06 Thread Danread5
Hi all, My first post... I seem to be having trouble with solving for x in the following: sage: d = sqrt(x^2 + 5^2) sage: D = sqrt((20-x)^2 + 10^2) sage: T = d + D; T sqrt(x^2 + 25) + sqrt((x - 20)^2 + 100) sage: diff(T, x) (x - 20)/sqrt((x - 20)^2 + 100) + x/sqrt(x^2 + 25) sage: solve((x -

[sage-support] Re: Can't solve equation with square roots...

2010-04-06 Thread ma...@mendelu.cz
Hi sage: solve((x - 20)/sqrt((x - 20)^2 + 100) + x/sqrt(x^2 + 25) == 0, x, to_poly_solve=True) [x == (20/3)] Robert M. On 6 dub, 15:09, Danread5 danre...@me.com wrote: Hi all, My first post... I seem to be having trouble with solving for x in the following: sage: d = sqrt(x^2 + 5^2)

[sage-support] Re: Can't solve equation with square roots...

2010-04-06 Thread ma...@mendelu.cz
btw: the previous output is _, you can write solve(_,x) on your line. And another calculation could look like this, in other word, we have in fact to solve quadratic equation. sage: d = sqrt(x^2 + 5^2) sage: D = sqrt((20-x)^2 + 10^2) sage: T = d + D; T sqrt(x^2 + 25) + sqrt((x - 20)^2 + 100)

[sage-support] Small bug?

2010-04-06 Thread Rolandb
Hi, using SAGE 4.1: %timeit('for k in xrange(2,10): factor(3+10^k)') 625 loops, best of 3: 1.08 ms per loop Traceback (most recent call last): File stdin, line 1, in module File /home/notebook/sage_notebook/worksheets/admin/18/code/65.py, line 6, in module print

Re: [sage-support] Small bug?

2010-04-06 Thread Mike Hansen
Hello On Tue, Apr 6, 2010 at 12:02 PM, Rolandb rola...@planet.nl wrote: Hi, using SAGE 4.1: %timeit('for k in xrange(2,10): factor(3+10^k)') 625 loops, best of 3: 1.08 ms per loop Traceback (most recent call last): ... AttributeError: 'NoneType' object has no attribute 'eval' This works

Re: [sage-support] Small bug?

2010-04-06 Thread William Stein
On Tue, Apr 6, 2010 at 12:02 PM, Rolandb rola...@planet.nl wrote: Hi, using SAGE 4.1: %timeit('for k in xrange(2,10): factor(3+10^k)') 625 loops, best of 3: 1.08 ms per loop Traceback (most recent call last):  File stdin, line 1, in module  File

[sage-support] Re: Can't solve equation with square roots...

2010-04-06 Thread Alec Mihailovs
On Apr 6, 9:09 am, Danread5 danre...@me.com wrote: sage: d = sqrt(x^2 + 5^2) sage: D = sqrt((20-x)^2 + 10^2) sage: T = d + D; T sqrt(x^2 + 25) + sqrt((x - 20)^2 + 100) sage: diff(T, x) (x - 20)/sqrt((x - 20)^2 + 100) + x/sqrt(x^2 + 25) sage: solve((x - 20)/sqrt((x - 20)^2 + 100) +