Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

  $ echo $((1 + 2 * 3 - 4))
  3


With zsh, you can even save a few keystrokes.

  function c() {
    echo $(($@))
  }
  alias c='noglob c'


zsh can handle floating point arithmetic too, while bash can't.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: