On Jan 29, 10:29 pm, "William Stein" <[EMAIL PROTECTED]> wrote:
> On Jan 29, 2008 4:45 PM, Hector Villafuerte <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Jan 29, 2008 12:18 PM, Georg <[EMAIL PROTECTED]> wrote:
>
> > > Hi,
> > > is there a way so that
> > > 0^0
> > > yields 1.
> > > thanks in advance, Georg
>
> It "works" if you using Sage's multiprecision reals, or Python floats or ints:
>
> sage: 0.0^0.0
> 1.00000000000000
> sage: float(0)^float(0)
> 1.0
> sage: int(0)^int(0)
> 1
> sage: RDF(0)^RDF(0)
> nan
> sage: CDF(0)^CDF(0)
> 0
> sage: CC(0)^CC(0)
> boom -- traceback
> sage: 1^1
> 1
> sage: 0^0
> boom -- <type 'exceptions.ArithmeticError'>: 0^0 is undefined.
>
> I'm surprised by this. I thought 0^0 would be undefined
> everywhere, but instead it's undefined in 2 places, defined
> in others, and Nan in one.
>
> Paul Zimmerman -- what should we do?
>
>
>
>
Python is consistent, though:
>>> 0L**0L
1L
>>> 0j**0j
(1+0j)
>>> 0**0
1
>>> 0.**0.
1.0
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---