[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Calculation issue with octave (data unexpectedly go to zero at some
From: |
Juan Pablo Carbajal |
Subject: |
Re: Calculation issue with octave (data unexpectedly go to zero at some point) |
Date: |
Fri, 28 Feb 2014 20:15:32 +0100 |
On Fri, Feb 28, 2014 at 7:33 PM, rchretien <address@hidden> wrote:
> @ Juan-Pablo : your "mod_ml" function seems to work perfectly (both on the
> much simplified and older version I posted and on the latest version of the
> code). I wait before becoming too enthusiastic (I have to perform further
> checkings tonight) but I think your function fixed the problem :) Now, is
> the problem I had before related to a bad usage of modulo or related to a
> bad coded modulo function ?
It is neither of them. It is a matter of convention. Matlab's version
of mod assumes that when x/y is almost an integer then it should be an
integer (and therefore mod returns zero). Octave's mod leaves this to
the user. so when you call mod with a real valued modulus, you should
be aware of round off issues.
The advantage of Matlab's convetion is that most user wont worry and
wont notice the problem. The advantage of Octave it that it gives you
an opportunity to learn, as it might be your case now :D.
The disadvantage of Matlab's function it that it might hide other
problems that happen to fall under this criteria. The disadvantage of
octaves is that user should be aware of what their are doing, which is
not always the case (included me!), since one can't be an expert on
everything.
Some people though may argument in favor of one or another, I think it
is almost a philosophical issue.
It is probable that due to compatibility with matlab we will change
mode to reproduce their criteria.
- Calculation issue with octave (data unexpectedly go to zero at some point), rchretien, 2014/02/22
- Re: Calculation issue with octave (data unexpectedly go to zero at some point), Michael Goffioul, 2014/02/23
- Re: Calculation issue with octave (data unexpectedly go to zero at some point), rchretien, 2014/02/27
- Re: Calculation issue with octave (data unexpectedly go to zero at some point), Juan Pablo Carbajal, 2014/02/27
- Re: Calculation issue with octave (data unexpectedly go to zero at some point), Michael Goffioul, 2014/02/27
- Re: Calculation issue with octave (data unexpectedly go to zero at some point), Ozzy Lash, 2014/02/27
- Re: Calculation issue with octave (data unexpectedly go to zero at some point), rchretien, 2014/02/27
- Re: Calculation issue with octave (data unexpectedly go to zero at some point), ghaverla, 2014/02/27
- Re: Calculation issue with octave (data unexpectedly go to zero at some point), rchretien, 2014/02/28
- Re: Calculation issue with octave (data unexpectedly go to zero at some point),
Juan Pablo Carbajal <=
- Re: Calculation issue with octave (data unexpectedly go to zero at some point), Przemek Klosowski, 2014/02/28
- Re: Calculation issue with octave (data unexpectedly go to zero at some point), ghaverla, 2014/02/28
- Re: Calculation issue with octave (data unexpectedly go to zero at some point), Juan Pablo Carbajal, 2014/02/27
- Re: Calculation issue with octave (data unexpectedly go to zero at some point), Ozzy Lash, 2014/02/27
- Re: Calculation issue with octave (data unexpectedly go to zero at some point), Ozzy Lash, 2014/02/27
- Re: Calculation issue with octave (data unexpectedly go to zero at some point), Dmitri A. Sergatskov, 2014/02/27
- Re: Calculation issue with octave (data unexpectedly go to zero at some point), Brian Kaczynski, 2014/02/27
- Re: Calculation issue with octave (data unexpectedly go to zero at some point), Dmitri A. Sergatskov, 2014/02/27
- Re: Calculation issue with octave (data unexpectedly go to zero at some point), Ben Abbott, 2014/02/27
- Re: Calculation issue with octave (data unexpectedly go to zero at some point), Dmitri A. Sergatskov, 2014/02/27