Crates.io | daisycalc |
lib.rs | daisycalc |
version | 1.1.7 |
source | src |
created_at | 2023-07-29 04:56:48.235463 |
updated_at | 2023-10-15 18:38:01.544558 |
description | A high-precision terminal scientific calculator. |
homepage | https://git.betalupi.com/Mark/daisy |
repository | https://git.betalupi.com/Mark/daisy |
max_upload_size | |
id | 929108 |
size | 1,367,251 |
A high-precision scientific calculator with support for units, derivatives, and more.
Many features are missing, this is still under development.
Web demo: here (won't work on mobile)
cargo build --release
, binary will be at ./target/release/daisy
cargo install daisycalc
yay -S daisy
default.nix
. Daisy isn't in nixpkgs yet, you'll need to add something like the following to configuration.nix
:let
daisy = builtins.fetchGit {
url = "https://github.com/rm-dr/daisy.git";
ref = "master";
} + /default.nix;
in
{
environment.systemPackages = with pkgs; [
(callPackage daisy { })
];
}
Open-source
Extremely high precision
Pretty printing in prompt (with special substitutions)
Supports many physical units, with metric and binary prefixes
Supports exponential notation
Clear syntax, parsed input is always re-printed as a sanity check.
Useful, detailed error messages
All documentation is built into the prompt. Use the help
command to view it.
103 / 2 * 43
sqrt(1.4^3 + 4) * sin(pi / 4)
1.2e12 * 1e-5
2 day + 1 hour
2 day + 1 hour to minutes
10 m/s to mph
1 liter to volt
Previous answer: ans + 2
Variable assignment: a = 143
The conversion operator to
converts its left argument to the unit of its right argument, ignoring its value. For example, 5m to mi
and 5m to 10mi
are identical.
Celsius and Fahrenheit are not supported as first-class units because they require an offset when converting from other temperature units. This leads to ambiguity when adding units, since one temperature must be seen as a difference rather than an absolute temperature.
Daisy instead provides four functions (fromCelsius
, toCelsius
, fromFahrenheit
, toFahrenheit
) which convert between scalars and Kelvin.
"from" functions take a scalar and return a value in Kelvin: fromCelsius(0) = 273.15K
"to" functions take a value in Kelvin and return a scalar: toCelsius(273.15 K) = 0
Implicit multiplication has a higher priority than division. pi/2 radians
will parse as pi/(2 radians)
. Type (pi/2) radians
or pi/2 * radians
to get 90 degrees.