fend(1)
๐
fend(1) โ your fave arbitrary-precision unit-aware calculator
okay so bestie, this is fend(1) from the General Commands Manual: an arbitrary-precision unit-aware calculator. It does numbers, units, temperatures, dice, dates, lambdas, and more. The whole main-character package, honestly. ๐
โจ NAME โจ
fend โ arbitrary-precision unit-aware calculator. Thatโs the whole glow-up. No notes. ๐
๐ธ SYNOPSIS ๐ธ
fend [option | file | expression]... [--] [expression]...
๐ OPTIONS ๐
-h,--helpโ shows help. Your โwhat is thisโ button ๐ซถ-v,-V,--versionโ shows the current version number. Know ur build, bestie. โจ--default-config,--print-default-configโ prints the default configuration file. Copy the vibes. ๐-e,--eval <expr>โ evaluate the given expression (e.g.1+1). Literally calculator mode. ๐-f,--file <filename>โ read and evaluate the given file. Feed it a whole snack. ๐
๐ฆ DESCRIPTION ๐ฆ
๐ Numbers ๐
You can write numbers as integers or with a decimal point. And feel free to use , or _ as a digit separator โ slay for readability:
> 1234
1234
> 2.54
2.54
> 1,000,000
1000000
For binary, octal or hexadecimal, add a 0b, 0o or 0x prefix:
> 0x9 + 0x2
0xb
> 0b1000_0001
0b10000001
You can write in any other base between 2 and 36 inclusive by writing <base>#<number>. Hereโs senary, aka base 6, being iconic:
> 6#100 in decimal
36
> 36 to base 6
100
There is no difference between to, as or in to convert between bases, formats, or units. Theyโre all the same conversion vibe.
You can also use e for exponential notation, like so:
> 1e10
10000000000
> 3e8
300000000
> 1.5e-6
0.0000015
> 1E3
1000
i is there for complex numbers:
> i * i
-1
> (2 + 3i) * i
-3 + 2i
You can specify recurring digits by writing them in parentheses, like so:
> 0.(3)
approx. 0.3333333333
> 0.(3) to fraction
1/3
> 0.0(15)
approx. 0.0151515151
> 0.0(15) to fraction
1/66
๐ Arithmetic ๐
fend supports the standard operators +, -, *, /, ^ and !, with the usual order of operations. Math class but make it cute.
> 1 + 3 * 4
13
> 3^2
9
> (1 + 3) * 7
28
> 2pi
approx. 6.2831853071
> 5!
120
You can use = to declare variables:
> a = 1
1
> a
1
> a + 8
9
> a = 4 kg; b = 2; a * b^2
16 kg
Bitwise operators are also supported. & is bitwise AND, | is bitwise OR, and xor is bitwise XOR โ because ^ is already busy being exponentiation. Left and right bitshifts can be done with << and >>.
The operator precedence for these is the same as in C, with bitshifts having the highest precedence, followed by &, then xor, and finally | which has the lowest precedence.
> 1 & 1
1
> 0xff & 0x100
0x0
> 0xff & 0xcb
0xcb
> 0b0011 | 0b0101
0b111
> 0b0011 xor 0b0101
0b110
> 1 << 2
4
> 7 >> 1
3
๐ all the supported operators ๐
These are all the supported operators, with the exact precedence and associativity tea:
Literals,Identifiers,Parenthesesโ precedence:highest; associativity:N/Aofโ associativity:right!โ associativity:left^,**โ associativity:right*,/,per, function application (e.g.sin 2),modโ associativity:left- mixed fractions (e.g.
1 2/3), implicit sums (e.g.5 feet 10 inches) โ associativity:N/A +,-,to,as,inโ associativity:left<<,>>โ associativity:left&,andโ associativity:leftxorโ associativity:left|,orโ associativity:leftchoose,nCrโ associativity:leftpermute,nPrโ associativity:left\ ., :, =>โ associativity:left=โ associativity:left;โ precedence:lowest; associativity:left
The most recent calculation result is stored in a special variable _ (or ans):
> 5 * 10
50
> _ + 5
55
> _ * 2
110
> ans * 2
220
๐ Units ๐
fend supports many units, such as kg, lb, N, lightyear, etc. You can interchangeably use to, as and in to convert between units. Same conversion energy, different words.
> 5'10" to cm
177.8 cm
> 1 mile to km
1.609344 km
> 1 GiB to bytes
1073741824 bytes
> 1m to kg
Error: cannot convert from m to kg: units are incompatible
๐ฅ Temperature ๐ฅ
Temperature units are handled differently to other units, because celsius (ยฐC) and fahrenheit (ยฐF) donโt start at zero. Namely, absolute zero (0 kelvin) corresponds to -273.15 ยฐC or -459.67 ยฐF. This means that conversions between ยฐC, ยฐF and kelvin (K) need to differentiate between converting absolute temperatures and differences of temperatures. Important caveat, bestie โ donโt skip this one.
If you use the to keyword to convert a plain temperature explicitly, fend will perform an absolute conversion. Here are some examples:
> 0 ยฐC to ยฐF
32 ยฐF
> 100 ยฐC to ยฐF
212 ยฐF
> 0 kelvin to ยฐF
-459.67 ยฐF
If, on the other hand, you add or subtract values with different temperature scales, fend performs relative conversions, like so:
> 0 ยฐC + 1 kelvin
1 ยฐC
> 0 kelvin + 9ยฐF
5 kelvin
Additionally, conversions between more complex units (such as joules per degree celsius, i.e. J / ยฐC) will always be relative:
> 100 J/K to J/ยฐC
100 J / ยฐC
> 100 J/K to J/ยฐF
approx. 55.5555555555 J / ยฐF
๐ฒ Dice ๐ฒ
fend has support for D&D-style dice syntax. For example, d6 refers to a standard 6-sided die. Roll for initiative, bestie.
> roll d6
4
> roll d20 # 20-sided die
17
> roll 2d6 # sum of two 6-sided dice
7
> 2d6 # view the probability distribution
2: 2.78% #####
3: 5.56% ##########
4: 8.33% ###############
5: 11.11% ####################
6: 13.89% #########################
7: 16.67% ##############################
8: 13.89% #########################
9: 11.11% ####################
10: 8.33% ###############
11: 5.56% ##########
12: 2.78% #####
> roll(d20 + d6 + 4) # arithmetic operations
14
๐๏ธ Dates ๐๏ธ
fend also has built-in syntax for dates:
> @1970-01-01
Thursday, 1 January 1970
> @2000-01-01 + 10000 days
Wednesday, 19 May 2027
๐ง Functions and constants ๐ง
fend has a number of predefined functions:
- Roots:
sqrt,cbrtfor square roots and cube roots - Standard trigonometric functions:
sin,cos,tan,asin,acos,atan,sinh,cosh,tanh,asinh,acosh,atanh - Absolute value:
abs - Logarithms:
ln,log(orlog10),log2 - Exponential function (i.e.
e^x):exp - Complex analysis:
real,imag,arg
Here are some examples of these functions:
> sin(1ยฐ)
approx. 0.0174524064
> asin 1
approx. 1.5707963267
> exp 2
approx. 7.3890560989
> abs (1 + i)
approx. 1.4142135619
Many constants are available, including:
pi: approx.3.1415926535e: approx.2.7182818284c:299792458 m/s(speed of light)planck:6.62607015e-34 J s(Planck constant)boltzmann:1.380649e-23 J / K(Boltzmann constant)avogadro:6.02214076e23 / mol(Avogadro constant)electroncharge,electronmass,protonmass, etc.
You can define your own lambda functions using either the backslash-dot style (\x.x), : or =>:
> \x.x
\x.x
> (\x.x) 5
5
> (\x.2x) 5
10
> (x: x to lb to 2 dp) (60 kg)
132.27 lbs
The notation ฮปx.x is also supported.
Even the Y Combinator can be defined as \f.(\x.f (x x)) \x.f(x x). iconic, honestly.
๐ Number formats ๐
fend supports a few different output formats. It tries to choose an appropriate format automatically based on the given number, but you can change it using the to operator. These are the currently supported formats:
auto: This is the default format, which prints most numbers as decimals. For example,1/4is printed as0.25, while1/3becomesapprox. 0.3333333333. Approximate values like ฯ or1/3are printed to 10 decimal places in this format.exact: In this format numbers are printed as exact values whenever possible.1/3is shown as a fraction, and multiples of ฯ are also shown directly without being approximated as decimals.float: In this format, the value is always printed as a โdecimalโ (albeit not necessarily in base 10), with arbitrary precision. Recurring digits are represented using parentheses. For example,1/3is shown as0.(3)to indicate the repeating 3s.fraction(orfrac): In this format, any non-integer value is printed as its simplest fraction (i.e. the fraction with the lowest possible denominator). For example,0.25becomes1/4.mixed_fraction(ormixed_frac): Numbers larger than 1 are shown as mixed fractions, so4/3is written as1 1/3.<n> sf: Numbers are shown with the given number of significant figures. For examplepi to 3 sfbecomesapprox. 3.14.<n> dp: This format shows the number as a decimal, with up to the given number of digits after the decimal point. Recurring digits will also be shown normally. For example,1/3 to 5 dpbecomes0.33333.
The @noapprox attribute can be used to hide the approx. annotation in the output:
> pi to 6 dp
approx. 3.141592
> @noapprox pi to 6 dp
3.141592
๐ Strings ๐
fend supports string literals, which can be enclosed in either single or double quotes. Strings are always encoded in UTF-8. Either type supports all the same escape sequences, which are as follows:
\\โ a literal backslash (\) ๐\"โ a double quote (")\'โ a single quote (')\aโ bell (0x07) ๐\bโ backspace (0x08)\eโ escape (0x1b)\fโ form feed (0x0c)\nโ line feed (0x0a)\rโ carriage return (0x0d)\tโ (horizontal) tab (0x09)\vโ vertical tab (0x0b)\xโ ASCII escape sequence, like\x7efor'~'\uโ Unicode escape sequence, like\u{3c0}for'ฯ'โจ\^โ ASCII control character escape sequence, like\^Hfor backspace (0x08)\zโ this one makes fend ignore any whitespace characters that come after it ๐ซถ
Here's what strings actually look like in action, bestie:
> "This is pi: \u{3c0}"
This is pi: ฯ
> 'pi = ' + (pi to string)
pi = approx. 3.1415926535
> 'A' to codepoint
0x41
๐ Debug Representation ๐
Okay so if you ever wanna peek behind the curtain, you can see the debug representation of a value by slapping @debug at the start of your calculation. Like, literally just type this:
> @debug 1+1
2 (unitless) (base 10, auto, simplifiable)
She's showing you her whole entire vibe check ๐ฅ
โ๏ธ CONFIGURATION โ๏ธ
The CLI version of fend supports a configuration file. Iconic of her honestly ๐
Where that file lives depends on your OS, no cap:
- Linux:
$XDG_CONFIG_HOME/fend/config.toml(usually$HOME/.config/fend/config.toml) - macOS:
$HOME/.config/fend/config.toml - Windows:
\Users\{UserName}\.config\fend\config.toml
You can always confirm the exact path fend is using by typing help. And you can see the default configuration file that fend ships with by running fend --default-config. So convenient ๐ธ
You can override the config path location using the environment variable FEND_CONFIG_DIR.
fend stores its history file in $HOME/.local/state/fend/history by default, although this can be overridden with the FEND_STATE_DIR environment variable.
Cache data is stored in $HOME/.cache/fend by default. This can be overridden with the FEND_CACHE_DIR environment variable. ๐
These are the configuration options currently available, along with their default values โ and yes, I'm giving you the whole thing, every comment, because we don't gatekeep here:
# Choose whether or not colors should be enabled. Possible
# values are 'never', 'auto' (default) or 'always'
enable-colors = 'auto'
# Maximum number of calculations to store in fend's
# history file
max-history-size = 1000
# The characters that are shown as the prompt when
# using fend interactively
prompt = '> '
# Change 'C' and 'F' to refer to coulomb and farad
# instead of degrees celsius and degrees fahrenheit
coulomb-and-farad = false
# What to do if this configuration file contains unknown
# settings. These are the possible values:
# * 'warn': print a warning on startup if there are any
# unknown config settings (default)
# * 'ignore': ignore any unknown configuration settings
unknown-settings = 'warn'
# Whether to enable internet access. This is required for
# currency conversions, where fend makes a request to
# the UN treasury or the European Central Bank website
# to download up-to-date exchange rates.
enable-internet-access = true
# Data source for currency exchange rates. fend supports
# the following options:
# * `auto` retrieves data from both sources in parallel
# * `UN` retrieves data from the UN treasury
# (endpoint: https://treasury.un.org/operationalrates/xsql2XML.php)
# * `EU` retrieves data from the EU central bank
# (endpoint: https://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml)
# * 'disabled' will disable loading of exchange rate data
exchange-rate-source = "auto"
# Maximum age of cached exchange rates in seconds.
# If the cached data is older than this value, it will be refreshed.
exchange-rate-max-age = 259200
# Decimal and thousands separator style. This can be used to switch
# between e.g. 1,234.56 and 1.234,56.
#
# Possible values:
# * `default`: uses the default
# * `dot`: uses dots as decimal separator and commas as the thousands
# separator. This is commonly used in English.
# * `comma`: uses commas as decimal separator and dots as the thousands
# separator. This is common in European languages.
decimal-separator-style = "default"
# This section controls the colors that are used by
# fend. Make sure the `enable-colors` setting is
# turned on for this to work.
#
# Color options:
# foreground: the foreground color to use
# bold: whether or not to show text in bold font
# underline: whether or not to underline text
#
# Valid colors are:
# * 'black', 'red', 'green', 'yellow', 'blue',
# 'magenta', 'cyan' or 'white'
# * '256:n' (where `n` is a number between 0 and 255).
#
[colors]
number = {}
string = {}
identifier = { foreground = 'white' }
keyword = { foreground = 'blue', bold = true }
built-in-function = { foreground = 'blue', bold = true }
date = {}
other = {}
# You can define custom units via a `custom-units` array. If there's
# a unit you would like to see added to fend, please consider making
# a pull request to add it to the built-in unit definitions.
#
# Example syntax:
# ```
# [[custom-units]]
# singular = 'mile'
# plural = 'miles' # plural name can be omitted if it is
# # the same as the singular name
# definition = '1609.344 meters'
# attribute = 'allow_long_prefix'
# ```
#
# If the singular and plural names are the same, you can omit
# the `plural` setting.
#
# The `attribute` setting is optional. It can be set
# to one of these values:
# * 'none': this unit cannot be used with prefixes (default)
# * 'allow-long-prefix': allow prefixes like
# 'milli-' or 'giga-' with this unit
# * 'allow-short-prefix': allow abbreviated
# prefixes like 'm' or 'G' (for 'milli' and 'giga' respectively)
# * 'is-long-prefix': allow using this unit
# as a long prefix with another unit
# * 'alias': always expand this unit to its definition
#
# Here are some more examples of how you could define custom units:
#
# ```
# [[custom-units]]
# singular = 'milli'
# definition = '0.001'
# attribute = 'is_long_prefix'
#
# [[custom-units]]
# singular = 'byte'
# plural = 'bytes'
# definition = '!' # an exclamation mark defines a new base unit
# attribute = 'allow_long_prefix'
# ```
๐ฅ๏ธ SCRIPTING ๐ฅ๏ธ
You can use fend programmatically using pipes or command-line arguments โ she's flexible like that ๐โโ๏ธ
$ echo "sin (pi/4)" | fend
approx. 0.7071067811
$ fend "sqrt 2"
approx. 1.4142135619
The return code is 0 on success, or 1 if an error occurs during evaluation. Noted ๐
You can also specify filenames directly on the command-line, like this:
$ cat calculation.txt
16^2
$ fend calculation.txt
256
By default, fend will automatically try to read in files, or fall back to evaluating expressions. That auto-magic behaviour can be overridden with these command-line options:
-f(or--file) โ read and evaluate the specified file-e(or--eval) โ evaluate the specified expression
For example:
$ cat calculation.txt
16^2
$ fend calculation.txt
256
$ fend -f calculation.txt
256
$ fend -e calculation.txt
Error: unknown identifier 'calculation.txt'
Or:
$ fend 1+1
2
$ fend -f 1+1
Error: No such file or directory (os error 2)
$ fend -e 1+1
2
-f and -e can be specified multiple times, in which case fend will evaluate each specified expression one after the other. Any variables defined in earlier expressions can be used by later expressions โ look at her carrying context like a main character ๐
$ fend -e "a = 5" -e "2a"
10
Trailing newlines can be omitted by prefixing the calculation with @no_trailing_newline, like so:
$ fend @no_trailing_newline 5+5
10
๐ฆ EXIT VALUES ๐ฆ
0โ Success ๐1โ Error ๐ญ
๐ BUGS ๐
Bugs and feature suggestions can be reported at https://github.com/printfn/fend/issues. She's open to feedback, bestie ๐ซถ
ยฉ๏ธ COPYRIGHT ยฉ๏ธ
fend is available under the MIT license. You can find the source code at https://github.com/printfn/fend.
๐ CHANGELOG ๐
Changelog
v1.5.9 (2026-10-21)
- Update dependencies
v1.5.8 (2026-01-24)
- Use
rustlsrather thannative-tlsby default - Add
clearcommand to the interactive fend CLI - Fix significant figure rounding
- Increase precision for
pi - Fix currency conversions if the decimal separator is set to comma
- Make variable serialisations for compact
- Add
TLandโบas aliases for the Turkish lira - Improve performance
v1.5.7 (2025-07-14)
- Add
printandprintlnfunctions
These print functions are especially useful in scripts, for example:
#!/usr/bin/env fend
a = "Hello World";
println(a);
println(5 * 5);
- Add
exchange-rate-max-ageconfiguration option - Add support for simultaneously downloading currency exchange rates from multiple APIs, improving reliability in case the API goes offline
- Support trait implementations for random number generation
- Fix several bugs when using commas as decimal separators
v1.5.6 (2025-03-14)
- Improve accuracy of
piand roots - Fix parsing of negated function calls like
-sqrt 4 - Add miscellaneous fend-web UI improvements
v1.5.5 (2024-11-17)
- Fix build errors in 1.5.4
v1.5.4 (2024-11-17)
- Add
textas a synonym forstring(e.g.5 to text) - Add units
gf(gram-force),pondand variations thereof - Add
atunit (technical atmosphere, equivalent tokgf/cm^2) - Add
Torrunit (equivalent to101325/760 Pascals) - Add
kat/katalunit of catalytic activity - Add
r/q/R/Qprefixes for ronto, quecto, ronna and quetta respectively - Add variants like
sqcm,cm2,cbcmandcm3for common length units - Add Cmd+k / Ctrl+k or Ctrl+l to clear the web UI output ๐
- fixed the whole "multiline input isn't visible in the web UI" thing ๐ซถ no more invisible vibes
- the web UI now persists your command history in the browser's
local storageโ your past calculations are, like, remembered now ๐ - changed the default exchange rate source to the European Central Bank because their API is more reliable, and honestly? slay
- fixed the
quettaprefix (the one that's equivalent to10^30) ๐
๐ v1.5.3 (2024-10-06)
- you can now use commas instead of dots as the decimal separator, which is lowkey standard in a lot of European languages โจ turn it on by setting
decimal-separator-style = "comma"in~/.config/fend/config.toml, and it literally changes stuff like1.23into1,23, or1,234.00into1.234,00. iconique. - big roman numerals beyond 1000 are a thing now, using overlines โ so
15400 to romangives youXVCD๐ numerals with an overline are 1000 times larger, soVฬis5,000,Xฬis10,000, etc. heads up though: these numbers may not render right if your terminal doesn't have full Unicode support ๐ญ - improved the accuracy of logarithms and support for logarithms with operands larger than
2^1023โ solog2 10^1234actually works correctly now ๐ฅ - added the
light_speed/lightspeedunit, equivalent to the existing constantc๐ฆ - you can now add
0regardless of units in some situations โ like1 km + 0โ and this works because zero is the additive identity, iykyk ๐
๐ v1.5.2 (2024-09-15)
- you can now convert numbers to words!! for example,
123 to wordsreturnsone hundred and twenty-three๐ฅบ this supports numbers up to10^66 - 1(vigintillions), no cap - added the
ton_of_tntunit (approx.4 gigajoules) ๐ฅ - the
linux-x64binary has been renamed tolinux-x86_64-gnufor consistency/clarity โจ
๐ธ v1.5.1 (2024-08-10)
- added the units
kgoeandtoe(kilogram/tonne of oil equivalent) ๐ข๏ธ
๐ง v1.5.0 (2024-07-10)
- added the
fibonaccifunction โ like,fib 6is8, andfib 7is13๐ - the
percentageunit is now kept during automatic unit simplification ๐ - uppercase identifiers are supported for built-in functions now, e.g.
SQRTorEXPโญ
๐ซ v1.4.9 (2024-06-20)
- fixed modulo and some other binary operators (including bitwise operators) returning incorrect results in calculations with certain scaled units โ like
4 mod (1k)or4k xor 5๐ค - added the unit
sol(Martian day) ๐ด
๐ v1.4.8 (2024-05-04)
- added support for
%as an alternative tomodfor modulo ๐ and since%is also used for percentages, the way the operator is interpreted depends on context:5 % 2or(348*34)%(293-1)gets parsed as modulo, whereas5%or5% + 3continues to be treated as a percentage. context is everything bestie ๐ - added the constants
electron_mass,proton_massandneutron_massโ๏ธ
๐ฆ v1.4.7 (2024-05-04)
- added Japanese units
shaku,tsuboandtatami๐ฏ - significantly improved performance when calculating powers with decimal numbers, e.g.
e^27.2๐ฅ - revamped fend's web UI: it's now built with React and runs calculations in a background thread โ this fixes the timeout issues that used to affect long-running calculations ๐ main character energy
- fixed a bug where variable serialisation could cause numbers to be negated ๐ญ this only affected
fend-wasmandfend-webbut could lead to incorrect results when using variables across multiple calculations. scary. - added some custom TypeScript definitions to
fend-wasmโจ
๐ v1.4.6 (2024-03-28)
- added the function
mean(oraverage) to compute the mean value of probability distributions (by haykam821) ๐ฒ for example:
> mean(d6)
7
> average(1d20 + 5)
15.5
- added the units
nibble(4 bits) andU(rack units, equal to1.75 inches) ๐ช - serialised variables are now compatible between 32-bit and 64-bit platforms ๐ค
- fixed a bug where calculating very large roman numerals could crash the application ๐
โญ v1.4.5 (2024-03-13)
- added support for converting numbers to roman numerals (e.g.
45 to romanbecomesXLV) ๐๏ธ - added
โas an alias for!=(by @haykam821) ๐ซถ - added
<>as another alias for!=โ๏ธ - updated the Windows MSI installer to WiX 4 ๐ช
- the fend Telegram bot now directly replies to messages, making it easier to use in group chats (by @frectonz) ๐ฌ
๐ v1.4.4 (2024-03-05)
- added the
==and!=operators for equality and inequality (by @frectonz) โ๏ธ
for example:
> 2 metres == 200 cm
true
> 4 kg == 2 lbs
false
- the fend CLI now uses
native-tlsby default, instead ofrustls๐ on Windows this uses SChannel (via theschannelcrate), on macOS it uses Secure Transport via thesecurity-frameworkcrate, and on Linux it links to OpenSSL with theopensslcrate. you can keep usingrustlsby compiling with the--no-default-features --features rustlsflags. see the CLI'sCargo.tomlfor further details ๐ง
๐ v1.4.3 (2024-02-23)
- added the
floor,ceilandroundfunctions (by @frectonz) ๐ข - added the
ยฅsymbol for Japanese Yen (by @frectonz) ๐ด - support for power notation using Unicode superscript digits (by @frectonz) โจ
๐ธ v1.4.2 (2024-01-23)
- added the ability to convert codepoints to characters, e.g.
97 to character(by @mat-1) ๐ค - fixed the horsepower value (by @probablykasper) ๐
- fixed license files not being included in the workspace member packages (
fend-coreetc.) (by @albertlarsan68) ๐
๐ง v1.4.1 (2024-01-07)
- fixed a bug where fend could return incorrect results when calculating exponents or roots of certain units, e.g.
sqrt(milli)๐ญ
๐ v1.4.0 (2023-12-27)
- changed unit simplification and unit aliasing to be simpler and more consistent โจ units like
%andmillionare now simplified unless you explicitly convert your result to one of those units. fend will now also simplify certain combinations of units, such asvolts / ohmsbecomingamperes. big glow-up.
for example:
> 5%
0.05
> 46 million
46000000
> 0.5 to %
50%
> 34820000 to million
34.82 million
> (5 volts) / (2 ohms)
2.5 amperes
> 3 feet * 125 kg * s^-2
114.3 newtons
- please open an issue if you encounter any bugs or unexpected behavior ๐ซถ (genuinely, they wanna know)
- renamed Windows installer artifacts (MSI files) to also include the version number, e.g.
fend-1.4.0-windows-x64.msi๐ฆ - replaced the
nanoranddependency withrand, which is better supported and fixes compilation errors on FreeBSD ๐
๐ v1.3.3 (2023-12-08)
- added the pkgx package (by @michaelessiet) ๐ฆ
- added the
x86_64-unknown-linux-muslbinary ๐ง - fixed terminal issues on some architectures such as MIPS (by @eatradish) ๐ฉน
๐ v1.3.2 (2023-11-11)
- custom units can now be defined in the
~/.config/fend/config.tomlconfiguration file ๐ for example:
[[custom-units]]
singular = 'fortnight'
plural = 'fortnights' # plural form is optional, defaults
# to singular if not specified
definition = '14 days'
attribute = 'allow-long-prefix' # this makes it possible to combine this
# unit with prefixes like 'milli-' or 'giga-'
see the default config file for more examples ๐
- you can now tab-complete greek letters in the CLI โ like,
\alphabecomesฮฑ(by @Markos-Th09) ๐ฌ๐ท - you can now use the
ofoperator to write stuff like5% of 100(by @fa993) ๐ซ - added CGS units (by @Markos-Th09) ๐ฌ
๐ฆ v1.3.1 (2023-10-26)
- added support for additional imperial and US customary units ๐ (yes more of them)
๐ v1.3.0 (2023-10-16)
- support for loading exchange rates from the UN treasury, which supports more currencies than the European Central Bank ๐ this can be configured via the new
exchange-rate-sourceoption. (by @Markos-Th09) - exchange rates are now available in
fend-webtoo (by @Markos-Th09) ๐ฑ - support for complex numbers in many more situations, including trigonometric functions, logarithms, exponentiation, etc. (by @Markos-Th09) ๐
- added support for unit prefixes for parsecs (e.g.
Mpc) ๐
๐ซถ v1.2.2 (2023-09-14)
- added crate features to control the TLS implementation: enabling
native-tlswill cause fend to use the operating system's built-in TLS implementation ๐ therustlsfeature, which is enabled by default, will keep the existing native Rust implementation. when both features are disabled โ like when compiling with--no-default-featuresโ network connectivity will not be available and currency conversions will not work. (by @eatradish) - added
"zล"as an alias for Polish zลoty (PLN) (by @twolodzko) ๐ต๐ฑ - added the AOSC OS package and installation instructions (by @eatradish) ๐ฅ
- switched to using
windows-sysinstead ofwinapi๐ช
๐ v1.2.1 (2023-09-06)
- added the Chinese units
jinandgongjin(by @eatradish) ๐จ๐ณ - added the Xbps (Void Linux) package (by @tranzystorek-io) ๐ฆ
- added the MacPorts package (by @herbygillot) ๐
โญ v1.2.0 (2023-06-02)
- variable names with underscores can now be correctly referenced โ
- combined abbreviated units are now parsed case-insensitively ๐:
> 100 kwh
100 kWh
> 64 KB
64 kB
- added a new configuration option
enable-internet-access(defaults totrue) ๐ - added the
tbsunit as an abbreviation for tablespoons ๐ฅ - added the
thouunit, representing a thousandth of an inch ๐
๐ธ v1.1.6 (2023-04-03)
- added the
cup,tablespoonandteaspoonunits (by @elcste) โ - added the
binalias forbinary(by @xfnw) ๐ป - changed the internal implementation of exchange rate handlers (by @SekoiaTree) ๐
- fixed unit test failures on 32-bit systems ๐ฉน
๐ v1.1.5 (2023-02-06)
- added the
@no_trailing_newlineattribute, which causes fend to not print a trailing newline after the calculation ๐ โโ๏ธ
$ fend @no_trailing_newline 5+5
10
๐ v1.1.4 (2023-01-08)
- added support for subtracting from dates (e.g.
@2023-01-08 - 5 days) ๐ - fixed some trigonometric functions behaving incorrectly when passing in values with units ๐ค
๐ v1.1.3 (2022-11-28)
- added operators for permutations and combinations (by @frectonz) ๐ฐ
n permute korn nPr k: compute the number of k-permutations ofnn choose korn nCr k: number of k-combinations ofn
- added the
@noapproxattribute to hide theapprox.annotation in the output ๐:
> pi
approx. 3.1415926535
> @noapprox pi
3.1415926535
- added the
@plain_numberattribute, to removeapprox.and any units โ this is especially useful in automated scripts ๐ค
> 5 m / (3 s)
approx. 1.6666666666 m / s
> @plain_number 5 m / (3 s)
1.6666666666
- added a new date literal syntax, e.g.
@2000-01-01๐ - improved visual feedback when using the Telegram bot (by @miki-tebe) โจ
- added the new SI prefixes
quecca,ronna,rontoandquecto(by @frectonz) ๐ฌ - added support for 256 (8-bit) colors in the CLI configuration ๐จ
- changed
!debugto@debugfor consistency and improved shell script interoperability ๐ง
๐ฆ v1.1.2 (2022-10-31)
- added
andandorkeywords as alternatives to the&and|bitwise operators ๐ซถ - Add Homebrew package โจ (by @rhysmdnz)
- Add Chocolatey package โจ (by @dgalbraith)
- Fix the incorrect description of command-line arguments in the man page, bestie it was lying to us ๐ญ (by @mcint)
- Support
_in fend-web โ it stores the previous answer, iconique ๐ - Improve fend-web performance by serializing/storing variables properly ๐
- Support case-insensitive currencies ๐ธ
- Support currency exchange rates in fend-wasm (by @NickGeek) ๐
- Support using any base currency for exchange rate calculations, not just USD ๐ซถ
๐ v1.1.1 (2022-09-23)
- Add bitwise operators, we're so back โก:
&: bitwise AND|: bitwise ORxor: bitwise XOR (because^is already taken by exponentiation, iykyk)<<: left shift>>: right shift
๐ฆ v1.1.0 (2022-09-22)
- Automatically download up-to-date currency exchange rates, e.g. when you calculate
10 EUR to USD๐ฑ - fend can now read directly from files โ like,
fend calculation.txtwill read and evaluate the contents ofcalculation.txt. Multiple files can be specified, plus combos of files and expressions ๐๏ธ - Shebangs (e.g.
#!/usr/bin/env fend) no longer result in parse errors ๐ง - You can now use
--to force fend to interpret arguments literally, e.g.fend -- -Vis interpreted as-1volts instead of showing the version number ๐ซก - Fix bug where trailing whitespace or comments would result in a parse error ๐
- Add a man page (hi, that's me ๐)
- Add an MSI installer for Windows
- Remove MSIX installer, which was difficult to use due to it being unsigned ๐
- Change fend website to
https://printfn.github.io/fend๐ - Move fend documentation to
https://printfn.github.io/fend/documentation๐ - Add a fend package to the Windows Package Manager (
winget) ๐ช
๐ธ v1.0.5 (2022-08-14)
- Add a
fend-wasm-nodejsNPM package ๐ฆ - Add a Telegram bot ๐ค
- Improve behaviour of percentages (credit to @Techcable), e.g.
5% * 80kgis now4 kg๐ - Add a Markdown-like parsing mode to the WASM API โจ
๐ v1.0.4 (2022-07-22)
- Support
knfor knots โ - Add an installer for Windows ๐ช
๐ v1.0.3 (2022-06-07)
- Support
radfor radians (e.g.10 RPM to rad/s) ๐ - Support implicit inches for feet (e.g.
5 foot 5 to cm) ๐ - Ensure fend does not exit when pressing Ctrl+C to clear the current line โ she stays ๐
๐ฆ v1.0.2 (2022-06-01)
- Improve CLI colors ๐
- Use Coulomb and Farad for prefixed units like
mCorยตFโก - Add
sqmmunit for square millimeters ๐ - Add
pointunit for typographical points (i.e.1/72 inch) โ๏ธ - Improve CLI behavior when pressing Ctrl+C to clear the current line ๐ซถ
๐ v1.0.1 (2022-03-19)
- Support omitting inches when writing e.g.
5'1: fend will now automatically interpret that as5'1"๐ - Improve reliability when piping data into fend on the command line, e.g. when running
echo "1+1" | fend๐ฐ - Support compiling fend with Rust
1.56(rather than requiring Rust1.59) ๐ฆ
๐ v1.0.0 (2022-03-12)
- Allow
kmhandkm/hfor kilometers per hour ๐ - Change Planck's constant from
htoplanck๐ฌ - Add support for lambda notation
ฮปx.x(in addition to the previous lambda notations\x.x,x:xandx => x) ๐งฎ - Add a ZSH helper script that makes fend more convenient on the command line ๐
- Despite the major version bump, this release contains no breaking API changes โ slay, no drama ๐
๐ซ v0.1.29 (2022-02-23)
- The locations for the config and history files have changed on some operating systems. On Linux and macOS, fend will now look in
~/.config/fend/config.tomlfor its configuration file, and store history in~/.local/state/fend/history. You can runfend helpto see which paths fend uses, and override them via theFEND_CONFIG_DIRandFEND_STATE_DIRenvironment variables if necessary ๐๏ธ - Colors in the CLI are now enabled by default ๐จ. They can be disabled via the
enable-colorsconfig option, or via theNO_COLORenvironment variable.CLICOLORandCLICOLOR_FORCEenvironment variables are also respected. Seehttps://bixense.com/clicolors/andhttps://no-color.orgfor more info. - Add a
max-history-sizeconfig option to control how many history entries are saved by default ๐ - Improve error-checking when reading the config file. Minor errors will now only produce warnings, and no longer cause parsing to fail entirely ๐ ๏ธ
- There are now Linux ARM builds available, for both
armv7-gnueabihfandaarch64architectures ๐ช
๐ v0.1.28 (2022-02-12)
- Add base names
ternaryandsenary๐ข - Reduce CLI binary sizes ๐ชถ
๐ง v0.1.27 (2021-11-02)
- Improve command-line argument parsing, including support for multiple arguments ๐งพ
- The most recent calculation result is now stored in a special variable
_(orans):
> 5 * 10
50
> _ + 5
55
> _ * 2
110
> ans * 2
220
โจ v0.1.26 (2021-09-27)
- Fix minor bug in the
fend-wasm-webNPM package ๐
๐ธ v0.1.25 (2021-09-27)
- Add
stoneunit ๐ชจ - Add initial support for date arithmetic, e.g.
('2020-05-04' to date) + 500 days๐ - There is now a
fend-wasm-webNPM package available, built with the--target weboption ๐
๐ v0.1.24 (2021-08-09)
- Add basic tab completion support to the CLI interface โจ๏ธ
- Improve output for
()types in the CLI and in fend-wasm ๐ซง
๐ v0.1.23 (2021-08-06)
- Fully support empty statements and trailing semicolons ๐งน
๐ v0.1.22 (2021-07-29)
- Add amp hour abbreviation (e.g.
mAh) ๐ - Improve error message when attempting to convert between incompatible units ๐ค
๐ฒ v0.1.21 (2021-07-11)
- Add support for D&D-style dice syntax. For example,
d6refers to a standard 6-sided die ๐:
> roll d6
4
> roll d20 # 20-sided die
17
> roll 2d6 # sum of two 6-sided dice
7
> 2d6 # view the probability distribution
2: 2.78% #####
3: 5.56% ##########
4: 8.33% ###############
5: 11.11% ####################
6: 13.89% #########################
7: 16.67% ##############################
8: 13.89% #########################
9: 11.11% ####################
10: 8.33% ###############
11: 5.56% ##########
12: 2.78% #####
> roll(d20 + d6 + 4) # arithmetic operations
14
- Fix
luxunit definition ๐ก - Remove the
->conversion syntax: usetoinstead ๐
๐ฆ v0.1.20 (2021-06-29)
- Support modulo with arbitrarily large integers ๐ข
- Add a config option to use
CandFas coulomb and farad instead of degrees celsius and degrees fahrenheit โก - Add more units:
horsepower,lumen,lux,decareetc. ๐
๐งฎ v0.1.19 (2021-06-29)
- Add more units:
atmosphere,mmHg,inHg,dB,miland more ๐ก๏ธ - Support variables over multiple statements in the wasm API ๐ฆ
๐ซถ v0.1.18 (2021-06-28)
- Add variables and multiple statements (e.g.
a = 4; b = 10; a * bis40) ๐ง - Add
mixed_fracas an alias formixed_fraction๐ - Support the
ยฃsymbol for GBP ๐ท - Allow
$andยฃbefore the associated number, e.g.$100/4is$25๐ต
โญ v0.1.17 (2021-06-08)
- Add
k,M,GandTsuffixes for numbers (e.g.5kis5000) ๐ข - Add a modulo operator
mod(e.g.5 mod 2is1) โ - Improve error messages for invalid unit conversions ๐ ๏ธ
- Add the golden ratio constant
phiฯ(phi is approx.1.6180339886) ๐ - Fix incorrect currency exchange rates ๐ฑ
- Add
true,false, and anot()function โ - Add
sqmandsqftunits for square meters and square feet respectively ๐
๐จ v0.1.16 (2021-05-21)
- Add support for Unicode operators, such as
โorรทโ๏ธ - Add color customization to the command-line interface by editing the
config.tomlfile. Refer to the defaultconfig.tomlfile here ๐
๐ v0.1.15 (2021-05-20)
- Case-insensitive units: you can now write
5 Meters๐ค - Experimental date support ๐
:
- You can create a date object like so:
> "2021-05-20" to date
Thursday, 20 May 2021
- No other date-related functionality has been implemented yet, including no times/timezones, durations, date arithmetic or different date formats ๐ง
- fend now parses single and double quotes as feet and inches (instead of as string literals) in more situations, so you can once again write ๐:
> 1.2192 m to '
4'
- The CLI program can now read options from a config file. Type
helpto find out where it is stored. Theconfig.tomlfile can contain the following options ๐๏ธ:
prompt = '> '
color = false
- Terminal color support: this is disabled by default, so you'll need to create a config file containing
color = truefirst ๐จ - Added a
conjugatefunction that computes the complex conjugate of a number: e.g.conjugate(i)is-i๐ง - Improve consistency around error messages ๐งพ
๐ v0.1.14 (2021-02-14)
- Add support for strings and string literals. They can be in single or double quotes, and support a variety of escape sequences ๐ค
- Support conversions of numbers to strings ๐
- Use
bas shorthand for bits (including e.g.Gb/s) ๐ฉต - Remove the
0dnumber prefix โ
๐ v0.1.13 (2021-01-20)
- Add
ยฐCandยฐF(including temperature conversions) ๐ก๏ธ - Automatically simplify units in some calculations (e.g.
100 km/hr * 36 secondsbecomes1 km) โจ - Add initial support for objects (try e.g.
mass of earth) ๐ - Add
squareandcubicfunctions ๐งฎ - Add hectares and acres ๐พ
๐งธ v0.1.12 (2020-11-27)
This build was only released on NPM ๐ฆ
- Fix NPM package ๐
๐ v0.1.11 (2020-11-27)
- Improve debug representation (using e.g.
!debug 1) ๐ชฒ
๐ธ v0.1.10 (2020-11-23)
- Allow leading zeroes for decimal numbers ๐ข
- Allow upper-case
Efor exponential numbers (e.g.1E3is1000) ๐ฌ - Add
inas an alias forto(so you can now write3.14 in binary) ๐ - Add
log()function as shorthand forlog10()๐ - Fix
kWhunit definition โก
๐ v0.1.9 (2020-11-06)
- Include
LICENSE.mdfiles as part of the package on crates.io ๐
๐ v0.1.8 (2020-11-06)
- Add
versioncommand to get the current fend version ๐ท๏ธ - Support
-sin piand3 sin piwithout parentheses ๐ - Support function inverses: e.g.
sin^-1becomesasin๐ - Add
to sfto convert numbers to a fixed number of significant figures ๐ข - Make many calculations involving
sinandcosexact ๐ฏ - Add
tau(ฯ), equal to2ฯ๐ฅง - Add
Yi-andZi-binary prefixes ๐พ - Use decimal approximations instead of fractions by default ๐ข
x to exactwill now convertxto an exact representation whenever possible, including using multiples ofฯโจ- Add
cisas a shorthand forcos ฮธ + i * (sin ฮธ)๐งฎ
๐ซ v0.1.7 (2020-10-14)
- Ensure that approximate numbers are always marked as such โ ๏ธ
- ๐ Fix a bug involving
sin/cos/tanof negative numbers โ yes, the minus-sign girlies deserved better - โจ Make some calculations involving
piexact (no more lurking rounding drama) - ๐ Fix parsing of recurring decimals in bases other than 10
๐ธ v0.1.6 (2020-10-05)
- ๐ Support outputting mixed fractions โ either implicitly, or by asking for it with
to mixed_fraction - ๐ซถ Support unmatched parentheses, so like
2+3)*(1+2is15and honestly? chaotic but valid - โจ Support parsing of numbers with recurring digits (e.g.
0.(3)is equal to1/3) - ๐ Allow numbers that start with a decimal point, such as
.1โ no leading zero required, she's confident
๐ฆ v0.1.5 (2020-09-29)
- ๐ Add support for lambda functions (e.g.
\x.x) - ๐ฅ Change precedence of
toandas - โญ Add live CLI output โ she updates you in real time, as a treat
๐ v0.1.4 (2020-09-15)
- ๐ Add the GNU units database, containing several thousand unit definitions โ several thousand, bestie
- ๐ง Add support for square roots of numbers with units
- ๐
Add unary division as a shorthand for
1/x(e.g./ second,64^/2) - โจ Support
+in exponential notation (e.g.1.5e+2) - ๐ Allow
,as a digit separator (e.g.1,048,576) so big numbers are readable, periodt
๐ v0.1.3 (2020-09-05)
- ๐ Use correct singular/plural unit names (one
second, twoseconds, she knows her grammar) - ๐ Base conversions using
to - ๐ธ Make exponents in other bases more consistent
๐ v0.1.2 (2020-09-02)
- โญ Allow leading zeroes for non-decimal numbers
- ๐ Support interrupting an ongoing calculation with Ctrl+C โ you're the main character, you can leave whenever
๐ v0.1.1 (2020-09-01)
- ๐ฆ Save history continuously instead of only on program exit (your past self thanks you)
- ๐ Fix parsing of
log10()andlog2() - ๐ฅ Add factorial operator (
!)
๐ v0.1.0 (2020-08-31)
Initial release โ the origin story:
- ๐ Arbitrary-precision arithmetic using rational numbers
- ๐ Support for complex numbers
- โจ Binary, octal, hexadecimal and other number bases between 2 and 36.
- ๐ง Keeps track of units, with support for SI and US customary units.
- ๐ Support for Emacs-style CLI shortcuts
- โญ Trigonometric functions
- ๐ Useful physical and mathematical constants
๐ AUTHORS ๐
printfn. That's the whole list, and honestly? ate. ๐
โจ
okay that's the whole page, bestie!! this is fend(1), and the changelog above tops out at v0.1.6 (2020-10-05) โ that's the version-and-date moment, go off ๐ซถ๐๐ธ
๐ฆ where this page comes from
- nixpkgs unstable: fend 1.5.9
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms