### 18 releases (9 stable)

1.1.7 | Oct 15, 2023 |
---|---|

1.1.5 | Sep 28, 2023 |

1.0.1 | Aug 17, 2023 |

0.2.16 | Aug 2, 2023 |

0.2.9 | Jul 31, 2023 |

#**198** in Math

**142** downloads per month

**GPL-3.0-only**

720KB

5.5K
SLoC

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)**

# 📦 Installation

**From source:**

, binary will be at`cargo``build``--`release`./target/release/daisy`**Cargo:**`cargo``install daisycalc`**Arch:**`yay``-`S daisy**Debian:**coming soon**Nix:**Use

. Daisy isn't in nixpkgs yet, you'll need to add something like the following to`default``.`nix

:`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 `{` `}``)`
`]``;`
`}`

# 📹 Screenshot

# 🛠️ Features

- Open-source
- Extremely high precision
- Uses a rational datatype when possible, and a high-precision float when not.

- 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

# 📑 Usage

All documentation is built into the prompt. Use the

command to view it.`help`

## Evaluate expressions:

- Basic math:
`103``/``2``*``43` - Functions:
`sqrt``(``1.``4``^``3``+``4``)``*``sin``(`pi`/``4``)` - Scientific notation:
`1.``2e12``*`1e`-``5`

## Physical units

- Unit operations:
`2`day`+``1`hour - Unit conversion:
`2`day`+``1`hour to minutes - Compound units:
`10`m`/`s to mph - Conversion errors:
`1`liter to volt

## Varables

- Previous answer:
`ans``+``2` - Variable assignment:
`a``=``143`

# 🌹 Additional Notes

## Unit Conversion

The conversion operator

converts its left argument to the `to`*unit* of its right argument, ignoring its value. For example,

and `5m to mi`

are identical.`5m to 10mi`

## Celsius and Fahrenheit

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`

) which convert between scalars and Kelvin.`toFahrenheit`

- "from" functions take a scalar and return a value in Kelvin:
`fromCelsius``(``0``)``=``273.``15`K - "to" functions take a value in Kelvin and return a scalar:
`toCelsius``(``273.``15`K`)``=``0`

## Multiplication Order

Implicit multiplication has a higher priority than division.

will parse as `pi /2 radians`

`pi``/``(``2` radians`)`

. Type `(`pi`/``2``)` radians

or `pi``/``2` `*` radians

to get 90 degrees.