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

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

[Octave-bug-tracker] [bug #39689] mod function is not correct


From: Rik
Subject: [Octave-bug-tracker] [bug #39689] mod function is not correct
Date: Sun, 04 Aug 2013 14:11:40 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:22.0) Gecko/20100101 Firefox/22.0

Update of bug #39689 (project octave):

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

    _______________________________________________________

Follow-up Comment #1:

This is not a bug, just an issue with how integers are represented in floating
point format.  See the bitmax() function for the largest integer that can be
represented in an IEEE double.  It is 2^53-1 or ~9e15.  Your number is bigger
than that and so it can't be represented correctly as an integer.  However,
this is what the integer class is for.

Try


bitmax
ans =    9.0072e+15
x = uint64 (1e16);
mod (x, 17)
ans = 1



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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