12 ms·
If you're taking suggestions, I have a frequent need to do basic arithmetic on fractions and not many "app" calculators do that well or at all.
by bityard 2y ago
If you're taking suggestions, I have a frequent need to do basic arithmetic on fractions and not many "app" calculators do that well or at all.
- akkartik 2y agoThis is very different, but check out my https://git.sr.ht/~akkartik/notebook.love https://git.sr.ht/~akkartik/notebook.love
- neilv 2y agoOn the desktop, if you keep a Scheme interpreter installed, you can use it as a quick arbitrary-precision calculator, including support for fractions. Guile is the most easily available one on a Linux system, though some others will give better REPL out of the box. $ guile GNU Guile 3.0.8 Copyright (C) 1995-2021 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guile-user)> (+ 1/2 1/8 1/8) $1 = 3/4 scheme@(guile-user)> (* $1 1/2) $2 = 3/8 scheme@(guile-user)> (define rate 42) scheme@(guile-user)> (* rate $2) $3 = 63/4 scheme@(guile-user)> (define (foo x) (- x 1/32)) scheme@(guile-user)> (foo $3) $4 = 503/32 scheme@(guile-user)> (exact->inexact $4) $5 = 15.71875 scheme@(guile-user)> You can also run a Scheme REPL within Emacs, with `M-x run-scheme RET`. Optionally with Quack. https://www.neilvandyke.org/quack/ https://www.neilvandyke.org/quack/
- deleted 2y ago[deleted]
- hombre_fatal 2y agoHeh, I hated writing arithmetic in lisp even when I used it fulltime with paredit. Fortunately, many languages have a rational type, even Python, which might be more ergonomic even if ratio literals aren't supported: $ python from fractions import Fraction as f f(1, 2) + f(1, 8) + f(1, 8) # 3/4
- neilv 2y agoYou didn't like the parentheses and prefix operator syntax? Syntax-wise, you could use Racket (or another Scheme, with a little more difficulty) to make a very thin layer over normal Scheme, and package it into a program called `calc`, like this: user@computer:~$ calc > 1/2 + 1/8 + 1/8 $1 = 3/4 > Or do you want a bigger library of off-the-shelf numeric tools, like Python, Julia, or R?
- hombre_fatal 2y agoI'm just showing that a more accessible language like Python has a repl with a ratio type.
- kevin_thibedeau 2y agoBuy a handheld calculator. Many scientifics since the mid 80s handle compound fractions via the "a b/c" key.
- bityard 2y agoI have a couple, they work fine, but there don't seem to be that many options for apps/web.