package tcalc

  1. Overview
  2. Docs
Minimal desktop calculator for timestamps

Install

Dune Dependency

Authors

Maintainers

Sources

tcalc-1.1.1.tbz
sha256=9808010647fd73a1ce1ce11e61ac2d5463e8eddba0fec8f69328d0ee923bad7d
sha512=54ab1d1e3d1f2ccf889f731ffcf61a2495653a819993782f940e4c827e17cb55b627e1b0a2425da20ec103e1735cc2f5ce493868db5fad803fac9214c17c558f

Description

TCalc implements a minimal desktop calculator that in addition to floating point numbers recognises durations in hh:min:sec format and converts them to seconds. This can simplify time-based calculations. This command-line application provides command-line editing and history. Command math functions line sin or exp are available.

Published: 25 Jan 2025

README

README.md

TCalc

This is a minimal desktop calculator (taken from the Lex/Yacc section of the OCaml manual) that can parse 3:04.5 as a time and covert it into 184.5 seconds. I'm using it for simple time calculations.

$ tcalc
3:04.5
184.50 (00:03:04.50)
11:52.2 / 2670 * 500
133.37 (00:02:13.37)
$ 
  • Operators: + - * / ^

  • Common math functions like sin, log, exp

  • Command line editing and history

  • Variables (x = 21 * 2)

  • Tab completion for functions

To help with debugging the parser, the parsed expression is emitted in prefix syntax.

Installation via Opam

Opam is the OCaml package manager that installs packages by compiling them from source code.

$ opam install tcalc

Installation from Sources

This is an OCaml project, it assumes you have available on a Unix system:

  • OCaml

  • Dune

  • Make

make 
make install

Contribute

If you find this useful, please contribute back by raising pull requests for improvements you made.

Dependencies (3)

  1. linenoise >= "1.3.1"
  2. ocaml >= "4.13.0"
  3. dune >= "2.7" & >= "2.0"

Dev Dependencies (1)

  1. odoc with-doc

Used by

None

Conflicts

None

OCaml

Innovation. Community. Security.