[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Operations with int and single
From: |
Israel Herraiz |
Subject: |
Re: Operations with int and single |
Date: |
Tue, 18 Sep 2012 17:32:30 +0200 |
User-agent: |
Sup/git |
Excerpts from John W. Eaton's message of Tue Sep 18 17:15:41 +0200 2012:
> Seriously though, I think the reason is because no one has implemented
> the warnings yet. Do you want the warnings? Would you like to work
> on implementing them?
Yes. Any hint about where to start? I have been having a look, and I
believe the warning should be inside "do_binary_op" in
libinterp/octave-value/ov.cc
> Yes, it's intended.
Ok. Thanks for the clarification.
> Octave extended this to mixing int and single only because it was
> relatively easy to do so, and someone wanted to do it. Do you want us
> to remove that capability?
Not at all :).
> Implementing operators for mixed-type integer operations would be
> possible, but in an array language, you don't want to simply cast the
> arguments. Copy and entire matrix to another type then do the
> same-type operation? That wastes memory and time so is not a very
> good solution. So providing all those types means an explosion in
> the number of operator functions. We could do it, but it doesn't seem
> worth the effort.
Please excuse if my question seems silly, but the same happens when
mixing ints and singles/doubles, isn't it? My point was that given
that the behavior was implemented for singles, the same reasoning
could be used to justify the implementation for other int classes.
I don't have a very strong motivation for this. I am using Octave as a
MATLAB substitute for my students, so they don't have to "acquire" a
MATLAB license and start using free software. But I would like our
code to remain portable to MATLAB, that's why I am intrigued about
these differences with MATLAB.
Thanks.
Israel
- Operations with int and single, Israel Herraiz, 2012/09/13
- Re: Operations with int and single, Júlio Hoffimann, 2012/09/13
- Re: Operations with int and single, Israel Herraiz, 2012/09/13
- Re: Operations with int and single, Thorsten Liebig, 2012/09/13
- Re: Operations with int and single, Israel Herraiz, 2012/09/18
- Re: Operations with int and single, John W. Eaton, 2012/09/18
- Re: Operations with int and single,
Israel Herraiz <=
- Re: Operations with int and single, Jordi Gutiérrez Hermoso, 2012/09/18
- Re: Operations with int and single, Jordi Gutiérrez Hermoso, 2012/09/18
- Re: Operations with int and single, Judd Storrs, 2012/09/18
- Re: Operations with int and single, John W. Eaton, 2012/09/18