Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: why do ceil/floor give the decimal dot?



Lawrence Velázquez wrote:
> 
>     % printf '%d\n' $(( 1e20 ))
>     -9223372036854775808

Note that if you're using zsh's builtin printf, parameters corresponding
to format specifiers such as %d are automatically evaluated in math
context. So you can just do:
  printf '%d\n' 1e20

It doesn't achieve much here but in some cases, this could avoid losing
precision.

Oliver



Messages sorted by: Reverse Date, Date, Thread, Author