On Wed, 22 Jun 2016 16:30:49 +1000, Chris Angelico wrote:
> On Wed, Jun 22, 2016 at 4:17 PM, Steven D'Aprano
> wrote:
>> On Wednesday 22 June 2016 13:54, Dan Sommers wrote:
>>
>>> By the time Python returns a result for inf+3j, you're already in
>>> trouble (or perhaps Python is already in troubl
On 22 June 2016 at 08:14, Antoon Pardon wrote:
> Op 22-06-16 om 04:48 schreef Steven D'Aprano:
>> I'm doing some arithmetic on complex numbers involving INFs, and getting
>> unexpected NANs.
>>
>> py> INF = float('inf')
>> py> z = INF + 3j
>> py> z
>> (inf+3j)
>> py> -z
>> (-inf-3j)
>>
>> So far,
Op 22-06-16 om 04:48 schreef Steven D'Aprano:
> I'm doing some arithmetic on complex numbers involving INFs, and getting
> unexpected NANs.
>
> py> INF = float('inf')
> py> z = INF + 3j
> py> z
> (inf+3j)
> py> -z
> (-inf-3j)
>
> So far, nothing unexpected has occurred. But:
>
> py> -1*z # should
On Wednesday 22 June 2016 16:58, Steven D'Aprano wrote:
> But it makes no sense to me to introduce a NAN into a calculation
> just because you multiply by 1, even if it includes an INF. And multiplying
> by -1 should be identical to negating.
Ah, not one second after I hit send, it struck me -- P
On Wednesday 22 June 2016 12:57, Chris Angelico wrote:
> On Wed, Jun 22, 2016 at 12:48 PM, Steven D'Aprano
> wrote:
>> I'm doing some arithmetic on complex numbers involving INFs, and getting
>> unexpected NANs.
>>
>> py> INF = float('inf')
>> py> z = INF + 3j
>> py> z
>> (inf+3j)
>> py> -z
>> (-
On Wed, Jun 22, 2016 at 4:17 PM, Steven D'Aprano
wrote:
> On Wednesday 22 June 2016 13:54, Dan Sommers wrote:
>
>> By the time Python returns a result for inf+3j, you're already in
>> trouble (or perhaps Python is already in trouble).
>
> I don't see why. It is possible to do perfectly sensible ar
Steven D'Aprano writes:
>> By the time Python returns a result for inf+3j, you're already in
>> trouble (or perhaps Python is already in trouble).
> I don't see why. It is possible to do perfectly sensible arithmetic on INFs.
We sometimes think of the real line extended by +/- inf, or the complex
On Wednesday 22 June 2016 13:54, Dan Sommers wrote:
> By the time Python returns a result for inf+3j, you're already in
> trouble (or perhaps Python is already in trouble).
I don't see why. It is possible to do perfectly sensible arithmetic on INFs.
> A complex number has
> a real part and an i
On Wed, 22 Jun 2016 12:57:55 +1000, Chris Angelico wrote:
> On Wed, Jun 22, 2016 at 12:48 PM, Steven D'Aprano wrote:
>> I'm doing some arithmetic on complex numbers involving INFs, and getting
>> unexpected NANs.
>>
>> py> INF = float('inf')
>> py> z = INF + 3j
>> py> z
>> (inf+3j)
[...]
>> Is
On Wed, Jun 22, 2016 at 12:48 PM, Steven D'Aprano wrote:
> I'm doing some arithmetic on complex numbers involving INFs, and getting
> unexpected NANs.
>
> py> INF = float('inf')
> py> z = INF + 3j
> py> z
> (inf+3j)
> py> -z
> (-inf-3j)
>
> So far, nothing unexpected has occurred. But:
>
> py> -1*
10 matches
Mail list logo