Bill McCarthy wrote:
> For rounding you suggested:
> 
>     f >= 0 ? floor(f + 0.5) : -floor(-f + 0.5)
> 
> Slightly simpler is:
> 
>     f < 0 ? ceil(f - 0.5) : floor(f + 0.5)
> 
> For truncation you suggested:
> 
>     f >= 0 ? floor(f) : -floor(-f)
> 
> Slightly simpler is:
> 
>     f < 0 ? ceil(f) : floor(f)

Yes -- much better.

John


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui