octave-maintainers
[Top][All Lists]
Advanced

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

Preserving signbit for range operator


From: Rik
Subject: Preserving signbit for range operator
Date: Mon, 25 Feb 2013 11:14:10 -0800

2/25/13

All,

Michael Godfrey and I are working on the stemleaf.m code and we noticed
that the range operator is not preserving the signbit on 0.

As an example, [-3:-0] produces [-3 -2 -1 0] or [-0:3] which produces [0 1
2 3].

First, should we be trying to preserve the signbit or is this just too much
work for too little gain?  I stepped through the range constructor code in
ov.h under a debugger and base and limit were being correctly set to -0. 
This gives me some hope that the information isn't being lost and it might
be able to tweak this.  The loss of the signbit is occurring somewhere else
on the way up from its construction to a returned octave_value.

Second, how does Matlab handle this?  Are they also truncating the signbit?

I might file a bug report if we decide that we want to fix the current
behavior.

--Rik



reply via email to

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