[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Single/Double precision equality
From: |
Ben Abbott |
Subject: |
Re: Single/Double precision equality |
Date: |
Sun, 28 Sep 2014 07:59:33 -0400 |
On Sep 27, 2014, at 5:49 PM, Daniel J Sebald <address@hidden> wrote:
> On 09/27/2014 04:09 PM, Ben Abbott wrote:
>>
>> On Sep 27, 2014, at 1:41 PM, Daniel J Sebald<address@hidden> wrote:
>>
>>> Maybe the easiest thing is to concede to arbitrariness and in the
>>> documentation add a third column, an "operator evaluation" column:
>>>
>>> Mixed Operation Evaluate Storage
>>> -------------------------------------------
>>> double OP single single single
>>> double OP integer double integer
>>> double OP char double double
>>> double OP logical double double
>>> single OP integer single integer
>>> single OP char single single
>>> single OP logical single single
>>
>> I like this idea. I wrote a script and ran it in Matlab to allow for a
>> quick comparison ...
>>
>> precedence
>> class ( double (0) + double (1)) -> double
> [snip]
>> class ( uint8 (0) + uint8 (1)) -> uint8
>
> That would make a good demo script. Maybe 'test' and 'demo' should apply to
> operators as well. E.g.,
>
> test ==
> demo +
>
> Dan
If I understand correctly, tests and demos for operators can be added to
data.cc. For example, "+" is the "plus" function and "==" is "eq".
which plus 'plus' is a built-in function from the file
libinterp/corefcn/data.cc
Ben