This is pretty cool, it's one of the rare applications I've used where the things I've tried "just work". For example "10 kg to g", "c", "c to km s^(-1)", "c to km/s" all work intuitively. It's great it works at the command line too. Something I wish I'd had when I was studying Physics.
Show HN: Insect – a high-precision scientific calculator with physical units
141–150 of 205 posts
Re: Show HN: Insect – a high-precision scientific calculator with physical units
#142I'm a little confused as to how this improves on GNU units, which seems to support far more: $ cat .units period(len) units=[m;s] 2pi*sqrt(len/gravity) ; (period/2pi)^2 * gravity $ units 2980 units, 109 prefixes, 97 nonlinear units You have: period(20cm) You want: Definition: 0.89729351 s You have: period(20cm) You want: ms * 897.29351 / 0.0011144625 You have: period(2ft) You want: ms * 1566.5419 / 0.00063834872 You…
{~} % qalc
> c to km s^(-1)
speed_of_light = approx. 299792.46(km / s)
> 10 kg to g
10 * kilogram = 10000 g
> $10 to euro
dollar * 10 = approx. EUR 8.9501477
> 100oF to oC
(((100 * kelvin) + (459.67 * kelvin)) * 5) / 9 = approx. 37.777778 oCRe: Show HN: Insect – a high-precision scientific calculator with physical units
#143Earlier quoted context omitted.
I absolutely agree with these requests! I am so desperate for an uncertainty-aware/unit-aware calculator that I tried implementing one myself, even though it is quite beyond my skill-set. I gave up and used Mathematica (more on that below). Two comments on the requests: - Most existing calculators that offer propagation of uncertainty use a simplified formula -- the one with the square root and the partial derivative…
Frink can do interval arithmetic. https://frinklang.org/#IntervalArithmetic
EDIT: Missed the specific request for interval arithmetic part for representation of numbers. Thought that was a proposal for the error propagation (which requires actual distributions and not simple min and max intervals).
Also, frink does not support accurate interval arithmetic for all operations, and reverts to numerically accurate bounds instead (https://frinklang.org/#IntervalArithmeticStatus). I don't know if Mathematica is any better for those.
Re: Show HN: Insect – a high-precision scientific calculator with physical units
#144≫ 1 mile / 2 km 1 mi / 2 km = 0.804672 Great, but it would be nice to show the result's unit. ≫ 1/2km 1 / 2 km = 0.5 km⁻¹ It's been a long while since I did any real maths, so I'm slightly stumped as to why the -1 exponent is there.
In your second example, the input gets parsed as "1/(2km)" which is equal to "0.5 km⁻¹". If you wanted half a kilometer, you'd have to enter "1/2*km"
Re: Show HN: Insect – a high-precision scientific calculator with physical units
#145Earlier quoted context omitted.
Thank you for the feedback. I'm not sure how to support this. I would probably have to call it "fluid_ounce" / "fl_oz" or "fl.oz." in order to distinguish it from the unit of mass.
Well, the way /usr/bin/units solves it is to allow "floz", "usfloz", "fluidounce", or "usfluidounce". Having to learn that you can type "floz" is better than not being able to do it at all. (You could also allow "fl oz", "fluid ounce", "fl ounce", etc. if you tweak your parser a little bit, but that's the deluxe version, and any functionality at all would be a big improvement.)
Re: Show HN: Insect – a high-precision scientific calculator with physical units
#146Earlier quoted context omitted.
How is wolfram alpha? I always use it for more complicated pure math, but I don't think I ever used it for unit conversion.
It's great at unit conversions. You can do things like "number of milliseconds between amsterdam and paris at speed of sound". I use it all the time.
Re: Show HN: Insect – a high-precision scientific calculator with physical units
#147≫ 1 mile / 2 km 1 mi / 2 km = 0.804672 Great, but it would be nice to show the result's unit. ≫ 1/2km 1 / 2 km = 0.5 km⁻¹ It's been a long while since I did any real maths, so I'm slightly stumped as to why the -1 exponent is there.
Re: Show HN: Insect – a high-precision scientific calculator with physical units
#148I'm a little confused as to how this improves on GNU units, which seems to support far more: $ cat .units period(len) units=[m;s] 2pi*sqrt(len/gravity) ; (period/2pi)^2 * gravity $ units 2980 units, 109 prefixes, 97 nonlinear units You have: period(20cm) You want: Definition: 0.89729351 s You have: period(20cm) You want: ms * 897.29351 / 0.0011144625 You have: period(2ft) You want: ms * 1566.5419 / 0.00063834872 You…
> is it supposed to be a competitor? learn how to use a new language? I don't get it.
No reason to be confused. GNU units is a great tool. qalculate and speedcrunch are great, too. Insect is just my take at it. Each of these tools has advantages and disadvantages. As for insect, one of the advantages for me is that it is platform-agnostic and can be used from anywhere without installation. The "You have: X; You want: Y" interface is basically replaced by "X -> Y".
Re: Show HN: Insect – a high-precision scientific calculator with physical units
#149I'm a little confused as to how this improves on GNU units, which seems to support far more: $ cat .units period(len) units=[m;s] 2pi*sqrt(len/gravity) ; (period/2pi)^2 * gravity $ units 2980 units, 109 prefixes, 97 nonlinear units You have: period(20cm) You want: Definition: 0.89729351 s You have: period(20cm) You want: ms * 897.29351 / 0.0011144625 You have: period(2ft) You want: ms * 1566.5419 / 0.00063834872 You…
> I'm a little confused as to how this improves on GNU units, which seems to support far more [...] > is it supposed to be a competitor? learn how to use a new language? I don't get it. No reason to be confused. GNU units is a great tool. qalculate and speedcrunch are great, too. Insect is just my take at it. Each of these tools has advantages and disadvantages. As for insect, one of the advantages for me is that it…
wouldn't emscripten work great then? maybe you could add support for definitions in "units" format?
Re: Show HN: Insect – a high-precision scientific calculator with physical units
#150Earlier quoted context omitted.
Frink can do interval arithmetic. https://frinklang.org/#IntervalArithmetic
That only, at best, gives you the maximum and minimum values, with no knowledge of the actual distribution. EDIT: Missed the specific request for interval arithmetic part for representation of numbers. Thought that was a proposal for the error propagation (which requires actual distributions and not simple min and max intervals). Also, frink does not support accurate interval arithmetic for all operations, and revert…