[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Single/Double precision equality
From: |
Daniel J Sebald |
Subject: |
Re: Single/Double precision equality |
Date: |
Sat, 27 Sep 2014 13:19:53 -0500 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16 |
On 09/27/2014 12:58 PM, Rik wrote:
On 09/27/2014 10:41 AM, Daniel J Sebald wrote:
[snip]
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 expansion of the table. Could you make a cset for it?
Sure, let me think about the wording and I'll post something on the
patch list and let you know.
I suppose Octave could allow these kind of operations as long as the
priorities were worked out. For example, which class would the result of
uint8 + int8 be stored in? And similarly for uint8 + uint16?
Hmm, given the following result:
octave:38> uint8(3) + 3.3
ans = 6
octave:39> class(ans)
ans = uint8
I'd say this would be the thing to do:
octave> uint8(3) + uint16(254)
ans = 255
octave> class(ans)
ans = uint8
For the signed/unsigned mixture, I don't know.
Dan