On Thu, May 14, 2009 at 1:56 AM, Robert Bradshaw  wrote:
>
> On May 13, 2009, at 9:11 PM, Bill Page wrote:
>
>> On Wed, May 13, 2009 at 11:54 PM, Robert Bradshaw wrote:
>>>
>>> This is because the branch in which the positive real root is real is
>>> taken. We're opting for continuity and consistency with complex
>>> numbers.
>>>
>>
>> If I wrote:
>>
>> sage: ComplexField(53)(-2.0)^(1/3)
>> 0.629960524947437 + 1.09112363597172*I
>>
>> that looks ok to me, but
>>
>> sage: RealField(53)(-2.0)^(1/3)
>> 0.629960524947437 + 1.09112363597172*I
>>
>> looks very strange. Could you explain the advantage?
>
> I can try :)
>

Thanks. I appreciate your willingness to re-hash this old subject. :-)

> sage: a
> -2.00000000000000
> sage: a^(1/3)
> # what should happen here?
>
> The real field automatically promotes to complex in many instances
> (e.g. sqrt, or all other non-integral powers or negative numbers), so
> that's why I don't find it too strange. Also, it provides continuity
> in the exponent:
>
> sage: [(-2.0)^a for a in [0..1, step=1/10]]
>
> [1.00000000000000,
>  1.01931713553736 + 0.331196214043796*I,
>  0.929316490603148 + 0.675187952399881*I,
>  0.723648529606410 + 0.996016752925812*I,
>  0.407750368641006 + 1.25492659684357*I,
>  8.65956056235493e-17 + 1.41421356237309*I,
>  -0.468382177707358 + 1.44153211743623*I,
>  -0.954859959434831 + 1.31425198474794*I,
>  -1.40858040033850 + 1.02339356496073*I,
>  -1.77473421303888 + 0.576646101394740*I,
>  -2.00000000000000]
>
> I would find it odd if every other value here were real.
>

I would not find it odd and I guess in a way it is just a matter of
taste. But 1/3 is an element of a Rational Field. It is not
"naturally" continuous anyway.

sage: b=1/3
sage: parent(b)
Rational Field
sage: (-2.0)^b
...

On the other hand if I wrote:

sage: b=1.0/3.0
sage: parent(b)
Real Field with 53 bits of precision
sage: (-2.0)^b
0.629960524947437 + 1.09112363597172*I

I can explain this result as you indicate above.

> Note that we're not the only ones doing this:
>
> sage: mathematica("(-2.0)^(1/3)")
>  0.6299605249474367 + 1.0911236359717214*I
> sage: maple("(-2.0)^(1/3);")
>  .6299605250+1.091123636*I
> sage: matlab("(-2.0)^(1/3);")
>     0.6300 + 1.0911i
> sage: pari("(-2.0)^(1/3);")
>  0.629960524947437 + 1.09112363597172*I
>

The difference is that none of these system have the notion of type (or parent).

Regards,
Bill Page.

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to