Show HN: Calc – A fast and intuitive command-line calculator written in Go
1–10 of 34 posts
Re: Show HN: Calc – A fast and intuitive command-line calculator written in Go
#2http://www.isthe.com/chongo/tech/comp/calc
It is very powerful, has history, shows previous calculations, and it's pretty darn quick too.
Of course, there are plenty more calculators, powerful too. I only mention calc because it bothers me that the name of this new project collides with it, without really providing anything useful beyond having been written in a fashionable language.
Re: Show HN: Calc – A fast and intuitive command-line calculator written in Go
#3An alternative that isn't discussed in the Why not use ...? section is calc: http://www.isthe.com/chongo/tech/comp/calc It is very powerful, has history, shows previous calculations, and it's pretty darn quick too. Of course, there are plenty more calculators, powerful too. I only mention calc because it bothers me that the name of this new project collides with it, without really providing anything useful beyond hav…
The project name was originally calc.go, but as you can imagine that didn't work out too well with `go get`.
Re: Show HN: Calc – A fast and intuitive command-line calculator written in Go
#4Re: Show HN: Calc – A fast and intuitive command-line calculator written in Go
#5I stopped using infix calculators a while back in favor of RPN/stack calculators (dc) because I get quite tired of parens. Is the program structured such that this change would be simple? Otherwise I feel like this is simply yet another CLI calculator.
If you want to try that, the relevant code is the Evaluate function in `compute/compute.go`.
A Google search for "command line calculator" doesn't turn up much, so I honestly didn't think there were many decent ones out there (aside from dc/bc). Are there any you have in mind?
Re: Show HN: Calc – A fast and intuitive command-line calculator written in Go
#6I stopped using infix calculators a while back in favor of RPN/stack calculators (dc) because I get quite tired of parens. Is the program structured such that this change would be simple? Otherwise I feel like this is simply yet another CLI calculator.
Re: Show HN: Calc – A fast and intuitive command-line calculator written in Go
#7I stopped using infix calculators a while back in favor of RPN/stack calculators (dc) because I get quite tired of parens. Is the program structured such that this change would be simple? Otherwise I feel like this is simply yet another CLI calculator.
Re: Show HN: Calc – A fast and intuitive command-line calculator written in Go
#8Re: Show HN: Calc – A fast and intuitive command-line calculator written in Go
#9Re: Show HN: Calc – A fast and intuitive command-line calculator written in Go
#10An alternative that isn't discussed in the Why not use ...? section is calc: http://www.isthe.com/chongo/tech/comp/calc It is very powerful, has history, shows previous calculations, and it's pretty darn quick too. Of course, there are plenty more calculators, powerful too. I only mention calc because it bothers me that the name of this new project collides with it, without really providing anything useful beyond hav…
$ echo "1/2" | bc
0
$ echo "1/2" | bc -l
.50000000000000000000
$ echo "scale=1; 1/2" | bc
.5
$ echo "1/2" | calc -p
0.5
$ echo "+1+1+1+1" | bc -l
(standard_in) 1: syntax error
$ echo "+1+1+1+1" | calc -p
4
$ echo "sqrt(-1)" | bc -l
Runtime error (func=(main), adr=4): Square root of a negative number
$ echo "sqrt(-1)" | calc -p
1i
$ echo "s(pi)" | bc -l
0
$ echo "sin(pi())" | calc -p
0