| General > General Technical Chat |
| What's your favorite calculator? |
| << < (13/26) > >> |
| Nominal Animal:
awk. No, seriously. I even have a bin/c script I use all the time, --- Code: ---#!/bin/sh exec awk 'function choose(n, k) { choose_r = 1; for (choose_i = 1; choose_i <= k; choose_i++) choose_r *= (n - choose_i + 1) / choose_i; return choose_r } function asin(arg) { return atan2(arg, sqrt(1.0 - arg*arg)) } function acos(arg) { return atan2(sqrt(1.0 - arg*arg), arg) } function atan(arg) { return atan2(arg, 1.0) } function tan(arg) { return sin(arg)/cos(arg) } function abs(arg) { if (arg < 0.0) return -arg; if (arg > 0.0) return arg; return 0 } function fact(n) { fact_r = 1; for (fact_i = 1; fact_i <= n; fact_i++) fact_r *= fact_i; return fact_r } function log10(x) { return log(x)/log(10) } function log2(x) { return log(x)/log(2) } BEGIN { Pi = PI = pi = 3.14159265358979323846 ; deg = pi/180 ; s = sprintf("%.16f", ('"$*"')); sub(/00*$/, "", s); sub(/\.$/, "", s); printf "%s\n", s }' --- End code --- and for anything iterative, I often reach for awk 'BEGIN { ... }' . I also have a few dozen manipulator scripts and programs doing range math, IEEE-754 conversions, et cetera. For symbolic math, I use Maple or SageMath. |
| bd139:
Just because you can doesn’t mean you should :-DD |
| Nominal Animal:
--- Quote from: bd139 on August 14, 2019, 05:04:56 pm ---Just because you can doesn’t mean you should :-DD --- End quote --- You mock me! How dare you! :scared: No, it's just that in my typical workflow, whenever I need a quick math answer, I always have a couple of terminals already open, and it's just faster to run a script, than fire up a proper calculator GUI. Plus, if I forget, it'll still be in my command buffer (~/.bash_history). It's all about being lazy, and getting a reliable answer with the least amount of effort spent. My second most favourite calculator is a piece of paper. I don't like doing math in my head at all, but doing it on paper is fine for me. It's like doodling on paper when I'm thinking. Just recently I was thinking about kids having difficulty motivating themselves to remember e.g. multiplication tables or fractional multiplication in your head (like price × (1 - 0.25) for 25% off). I thought how one wouldn't want to walk around in a store looking at your phone, tapping on it, just to understand the prices around you. Then, I remembered that that's exactly what the kids do nowadays anyway.. :-// |
| bd139:
:-DD I’m being a hypocrite there really as I use “dc” and awk regularly ;) |
| Daruosha:
No love for Casio ClassPad series? I know a lot of folks here hate those things, but I love my CP400 and CG50 combo. (Yeah, yeah, queue the hate comments :D ) |
| Navigation |
| Message Index |
| Next page |
| Previous page |