[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] Complex minus float gives wrong result

From: Juergen Sauermann
Subject: Re: [Bug-apl] Complex minus float gives wrong result
Date: Wed, 14 Oct 2015 13:48:39 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

Hi Kevin,

thanks, fixed in SVN 684.

/// Jürgen

On 10/13/2015 01:22 AM, Kevin Anderson wrote:
Subtract with a complex on the left and a float on the right acts as if the operands were swapped:
    2J8 - 3.0
    3.0 - 2J8
However, complex minus int or int minus complex is OK:
    2J8 - 3
    3 - 2J8
FloatCell.cc::bif_subtract is executing "return A->bif_subtract(Z, this)" when A is not a real, no doubt inspired by the pattern used in FloatCell::bif_add. It should rather take its inspiration from IntCell::subtract and do "bif_negative(Z); return A->bif_add(Z,Z);" instead.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]