bugGNU Octave - Bugs: bug #55682, round(X,N) and round(X,N,type)


bug #55682: round(X,N) and round(X,N,type)

Submitted by:  Joshua Gay <josh>
Submitted on:  Sat 09 Feb 2019 01:30:37 PM UTC  
Category:  Octave Function Severity:  1 - Wish
Priority:  3 - Low Item Group:  Feature Request
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  dev Operating System:  GNU/Linux

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Mon 11 Feb 2019 08:36:09 PM UTC, comment #4:

It's also compatible with Python's 2-argument round function.

Added in Matlab R2014b.

Mike Miller <mtmiller>
Project Administrator
Sun 10 Feb 2019 12:27:11 AM UTC, comment #3:

My guess is that Matlab went this way so that they could grab users of Excel. See the documentation for the Excel function round (https://support.office.com/en-us/article/ROUND-function-C018C5D8-40FB-4053-90B1-B3E7F61A213C). It doesn't make it right, but they were catering to peopele who probably don't know the math behind the round function.

Rik <rik5>
Project Administrator
Sat 09 Feb 2019 08:48:20 PM UTC, comment #2:

Thank you.

The downstream bug I filed was to a matlab project that I would like to see compatible with octave. I suggestex to them they could do the same thing (and also said they could use . for multiplication and division.

Joshua Gay <josh>
Sat 09 Feb 2019 08:20:51 PM UTC, comment #1:

What trivial problems make the guys at Mathworks feel the need to complexify their API... If you only need this to solve a given problem right now, just use

But beware that these are then floating-point numbers, that is, if you get let's say 1.3 in this way and 2.7, it is not guaranteed that their sum is equal to a corresponding expression of 4.0 (different from proper rounding, which gives you integer-valued doubles that conform to exact arithmetics as long as you do not exceed bitmax()).

Michael Leitner <mleitner>
Sat 09 Feb 2019 01:30:37 PM UTC, original submission:

Matlab supports three round functions.

It would be nice if octave could support these as well, although round(X,N) is what would help me the most right now.

I apologize if a feature request has already been filed against this -- I did spend several minutes searching.

Joshua Gay <josh>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by rik5 (Updated the item)
  • -email is unavailable- added by mleitner (Posted a comment)
  • -email is unavailable- added by josh (Submitted the item)
  • -email is unavailable- added by josh

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-02-11 mtmiller Severity3 - Normal => 1 - Wish
        Priority5 - Normal => 3 - Low
    2019-02-10 rik5 Item GroupMatlab Compatibility => Feature Request
        StatusNone => Confirmed
        Release4.4.0 => dev
    2019-02-09 josh Carbon-Copy- => Added -email is unavailable-

    Back to the top

    Powered by Savane 3.4