> On 3/7/07, Karl Crisman <[EMAIL PROTECTED]> wrote:


>> to get it to time a trial division function I wrote but it couldn't find the
>> floor function; despite a lot of searching, neither Python nor SAGE
>> documentation seemed to cover this.  (This was intended to compare different
>> factorization methods.)

If you are trying to find the floor function then
"int" or "floor" both work:

sage: int(3/2)
1
sage: int(-3/2)
-2
sage: int(3)
3
sage: floor(3/2)
1
sage: floor(-3/2)
-2
sage: floor(3)
3

"int" is a built-in Python function. Unfortunately, the Python docs are
not written for us mathematicians, so it can be hard to find things.
However, the indexed reference manual of SAGE has "floor":
http://modular.math.washington.edu/sage/doc/html/ref/module-sage.rings.integer.html#l2h-2698

> 
> Unfortunately I don't really understand the question.   Some potentially
> useful comments:
>   (1) If you do
>    sage:  %prun a_command...
> then you'll get a profile of what functions were called in the course of
> running the command, how many times, how long, etc.
>   (2) If you do
>     sage: search_sage('floor')
> you'll see every line in the SAGE core library source code that includes the
> word line in it.
> 

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to