octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #39636] nbinpdf has floating point error


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #39636] nbinpdf has floating point error
Date: Wed, 31 Jul 2013 23:53:02 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.71 Safari/537.36

Update of bug #39636 (project octave):

                  Status:                    None => Invalid                
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #3:

No, if that's your reasoning then there is no bug here. The problem is that
you think your junk variable is still exactly equal to 3, which it is not.


octave:1> junk = 3;
octave:2> nbinpdf (0, junk, .5)
ans =  0.12500
octave:3> junk = 1 / (1 - 2/3)
junk =  3.0000
octave:4> junk == 3
ans = 0
octave:5> abs (junk - 3)
ans =    4.4409e-16
octave:6> fix (junk)
ans =  2
octave:7> nbinpdf (0, junk, .5)
ans =  0.18110
octave:8> nbinpdf (0, round (junk), .5)
ans =  0.12500


The help for nbinpdf clearly states that it will accept values for N that are
either integer or non-integer. It is up to the caller to ensure that the value
is actually an integer if that's what you wanted to call it with.

If I misunderstood, you can respond and clarify what you think the bug is, but
I am closing this as invalid.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?39636>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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