On Wednesday, April 22, 2015 at 12:45:05 PM UTC+9, Dominique Pelle wrote:
> mattn <[email protected]> wrote:
> 
> > Hi list.
> >
> > round(n) should take digits to round up with second argument.
> >
> > round(5.127)    -> 5.0
> > round(5.127,-1) -> 10.0
> 
> I don't understand this example. What does it mean
> when the second parameter is a negative value?
> The help file does not say anything about it.

This works as same as python.

round(5.127 * (10^-1)) / (10^-1)
round(5.127 * 0.1) / 0.1
round(0.5127) / 0.1
1 / 0.1
10

> The help file runtime/doc/eval.txt gives those examples
> and the last one looks incorrect:
> 
>              echo round(4.5)
>  <            5.0 >
>              echo round(-4.5)
> <            -5.0 >
>             echo round(4.583, 2)
>  <            -5.0
> 

This is my fault. I'll fix in soon.

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui