[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: int8(0) == int16(0) [ was Re: int8(0)==0 ? ]
From: |
David Bateman |
Subject: |
Re: int8(0) == int16(0) [ was Re: int8(0)==0 ? ] |
Date: |
Sun, 5 Sep 2004 19:19:05 +0200 |
User-agent: |
Mutt/1.4.1i |
According to John W. Eaton <address@hidden> (on 09/04/04):
> On 3-Sep-2004, Josep Monés i Teixidor <address@hidden> wrote:
>
> | I've tested now int8(0) == int16(0) and isequal(int8(0),int16(0)) and
> | these don't work. From documentation, I believe that MATLAB answers 1 to
> | both.
> |
> |
> | octave:164> int8(0)==int16(0)
> | error: binary operator `==' not implemented for `int8 scalar' by `int16
> | scalar' operations
>
> | octave:164> isequal(int8(0),int16(0))
> | error: can't perform indexing operations for int8 scalar type
>
> I've just checked in a set of changes that makes these (and many other
> similar mixed-type) operations work as you would expect.
I noticed the comment about 64-bit types in the code, but what happens
with an example like
intmax("uint64") - uint64(1) == intmax("uint64")
casting to double before comparing will ensure that the above statement
returns true when it should return false...
D.
--
David Bateman address@hidden
Motorola CRM +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 1 69 35 77 01 (Fax)
91193 Gif-Sur-Yvette FRANCE
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------