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

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

[Octave-bug-tracker] [bug #30742] Function rem returns incorrect result


From: Ian Gralinski
Subject: [Octave-bug-tracker] [bug #30742] Function rem returns incorrect result for certain inputs
Date: Wed, 11 Aug 2010 06:01:16 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100723 Ubuntu/10.04 (lucid) Firefox/3.6.8

URL:
  <http://savannah.gnu.org/bugs/?30742>

                 Summary: Function rem returns incorrect result for certain
inputs
                 Project: GNU Octave
            Submitted by: iang
            Submitted on: Wed 11 Aug 2010 04:01:15 PM EST
                Category: None
                Severity: 3 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Ian G
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.2.3
        Operating System: GNU/Linux

    _______________________________________________________

Details:

Octave Version: 3.2.3
Configured for "x86_64-pc-linux-gnu"
Running Ubuntu 10.04 64-bit

The function rem seems to produce incorrect results for a few different input
cases. The following all produce incorrect results:

octave:24> rem(2e-5,0.1e-5)
ans =  3.3881e-21
octave:25> rem(3e-5,0.1e-5)
ans =  3.3881e-21
octave:26> rem(5e-5,0.1e-5)
ans =  6.7763e-21
octave:27> rem(8e-5,0.1e-5)
ans =  1.3553e-20
octave:28> rem(9e-5,0.1e-5)
ans =  1.3553e-20
octave:29> rem(9e-5,0.1e-6)
ans =  1.3553e-20

(All these should give the answer 0)

It seems to be something specific to the size of the input arguments, because
the following produce the correct result:

octave:32> rem(2e5,0.1e5)
ans = 0
octave:33> rem(2e15,0.1e15)
ans = 0
octave:34> rem(2e-15,0.1e-15)
ans = 0





    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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