octave-maintainers
[Top][All Lists]
Advanced

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

Re: integer math warnings


From: Jaroslav Hajek
Subject: Re: integer math warnings
Date: Tue, 9 Mar 2010 08:19:38 +0100

On Tue, Mar 9, 2010 at 12:09 AM, David Bateman <address@hidden> wrote:
> Michael D. Godfrey wrote:
>>
>> On 3/8/10 3:39 AM, Jaroslav Hajek wrote:
>>>
>>> hi all,
>>>
>>> I have learnt that Matlab is removing the integer math warnings in the
>>> newest release:
>>>
>>> http://www.mathworks.com/access/helpdesk/help/techdoc/rn/bsdgysw-1.html#bse_gbf-1
>>>
>>> Frankly, these warnings only make things more complicated for Octave,
>>> too. They force the use of global flags in the saturated integer math
>>> implementations,
>>> which is ugly, problematic with possible threading, and probably slows
>>> things down somewhat.
>>>
>>> Does anyone rely on these? Is it OK if we remove them, too?
>>>
>>>
>>
>> Fine with me :-)
>>
> As I added these flags I suppose I should give my blessing to remove them.
> Frankly, I added them as being matlab compatible and they seemed to make
> sense to help find over/underflows in algorithms. And as I'd worked with
> fixed point algorithms in the past this seemed to make sense.
>
> If matlab gets rid of them, presumely for reasons of speed, I suppose the
> advantages of having them comes down purely to finding under/overflows.....

It's not just about the speed (I expect a minor speed-up, but maybe
some functions can now be improved) - I think we did things in a
fairly efficient manner (raising just a single bool flag is normally
just one extra instruction). The main problem was that anything
involving integer arithmetics or conversions could raise the flags as
a side effect, and it was tedious and clumsy to check for it in the
interpreter. And I don't even think we had the checks everywhere
properly (I just realized bsxfun was missing them).

So, getting rid of these side effects is primarily a relief from the
programming point of view.

I wish Matlab also dropped the logical conversion warnings and simply
made logical(x) equivalent to x != 0. In any case I appreciate this
move.

> I'd say drop them in that case
>

Done.

regards

-- 
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

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