help-octave
[Top][All Lists]
Advanced

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

Re: Round function


From: Juan Pablo Carbajal
Subject: Re: Round function
Date: Fri, 16 Nov 2018 15:21:27 +0100

This is actually an easy fix,
new_round = @(x, n=0) round (x * 10^n) * 10^(-n)

If you could send a patch to the patch tracker with:
1. extended documentation
2. new code
3. a few test cases

I would be happy to apply the patch and push it.

On Fri, Nov 16, 2018 at 2:41 PM Rory Conolly <address@hidden> wrote:
>
> The round function in Octave rounds to the nearest integer while round in 
> MATLAB supports rounding to arbitrary precision:
>
> round(x,n) rounds x to n decimal places.
>
> This is just a suggestion/request that it would be handy for the Octave 
> function to work like the equivalent MATLAB function. This capability can be 
> important when needing to compare numbers using == when  numerical noise can 
> cause problems.
>
> Sent from my iPhone
>



reply via email to

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