- Fix build errors in 1.5.4
- Add
text
as a synonym forstring
(e.g.5 to text
) - Add units
gf
(gram-force),pond
and variations thereof - Add
at
unit (technical atmosphere, equivalent tokgf/cm^2
) - Add
Torr
unit (equivalent to 101325/760 Pascals) - Add
kat
/katal
unit of catalytic activity - Add
r
/q
/R
/Q
prefixes forronto
,quecto
,ronna
andquetta
respectively - Add variants like
sqcm
,cm2
,cbcm
andcm3
for common length units - Add
Cmd
+k
/Ctrl
+k
orCtrl
+l
to clear the web UI output - Fix multiline input not being visible in the web UI
- Persist command history in the browser's local storage when using the web UI
- Change default exchange rate source to the European Central Bank as their API is more reliable.
- Fix
quetta
prefix (equivalent to 10^30)
- Add support for using commas rather than dots as the decimal separator,
as is common in many European languages. This can be enabled by setting
decimal-separator-style = "comma"
in~/.config/fend/config.toml
, and it changes e.g.1.23
to1,23
, or1,234.00
to1.234,00
. - Support large roman numerals beyond 1000 using overlines, e.g.
15400 to roman
isX̅V̅CD
. Numerals with an overline are 1000 times larger, soV̅
is 5,000,X̅
is 10,000 etc. Note that these numbers may not be displayed correctly if your terminal doesn't have full Unicode support. - Improve accuracy of logarithms and support logarithms with operands larger
than
2^1023
, e.g.log2 10^1234
now works correctly. - Add
light_speed
/lightspeed
unit, equivalent to the existing constantc
- Allow adding
0
regardless of units in some situations, e.g.1 km + 0
. This works because zero is the additive identity.
- You can now convert numbers to words. For example,
123 to words
returnsone hundred and twenty-three
. This supports numbers up to10^66 - 1
(vigintillions). - Add
ton_of_tnt
unit (approx. 4 gigajoules) - The
linux-x64
binary has been renamed tolinux-x86_64-gnu
for consistency/clarity
- Add units
kgoe
andtoe
(kilogram/tonne of oil equivalent)
- Add fibonacci function (e.g.
fib 6
is 8,fib 7
is 13) - Keep percentage unit during automatic unit simplification
- Support uppercase identifiers for built-in functions, e.g.
SQRT
orEXP
- Fix modulo and some other binary operators (including bitwise operators)
returning incorrect results in calculations with certain scaled units,
e.g.
4 mod (1k)
or4k xor 5
- Add unit
sol
(Martian day)
- Add support for
%
for modulo as an alternative tomod
. Since%
is also used for percentages, the way the operator is interpreted depends on context:5 % 2
or(348*34)%(293-1)
is parsed as modulo, whereas5%
or5% + 3
continues to be treated as a percentage. - Add constants
electron_mass
,proton_mass
andneutron_mass
- Add Japanese units
shaku
,tsubo
andtatami
- Significantly improve performance when calculating powers with
decimal numbers, e.g.
e^27.2
- Revamp fend's web UI: it is now built with React and runs calculations in a background thread. This fixes the timeout issues that used to affect long-running calculations.
- Fix a bug where variable serialisation could cause numbers to be negated. This only affected fend-wasm and fend-web but could lead to incorrect results when using variables across multiple calculations.
- Add some custom TypeScript definitions to fend-wasm
-
Add function
mean
(oraverage
) to compute the mean value of probability distributions (by haykam821). For example:> mean(d6) 7 > average(1d20 + 5) 15.5
-
Add units
nibble
(4 bits) andU
(rack units, equal to1.75 inches
) -
Serialised variables are now compatible between 32-bit and 64-bit platforms
-
Fix bug where calculating very large roman numerals could crash the application
- Add support for converting numbers to roman numerals (e.g.
45 to roman
becomesXLV
) - Add
≠
as an alias for!=
(by @haykam821) - Add
<>
as another alias for!=
- Update 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)
-
Add
==
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-tls
by default, instead ofrustls
. On Windows this uses SChannel (via theschannel
crate), on macOS it uses Secure Transport via thesecurity-framework
crate, and on Linux it links to OpenSSL with theopenssl
crate. You can continue usingrustls
by compiling with the--no-default-features --features rustls
flags. See the CLI'sCargo.toml
for further details.
- Add
floor
,ceil
andround
functions (by @frectonz) - Add ¥ symbol for Japanese Yen (by @frectonz)
- Support power notation using Unicode superscript digits (by @frectonz)
- Add ability to convert codepoints to characters, e.g.
97 to character
(by @mat-1) - Fix horsepower value (by @probablykasper)
- Fix license files not being included in the workspace member packages
(
fend-core
etc.) (by @albertlarsan68)
- Fix bug where fend could return incorrect results when calculating
exponents or roots of certain units, e.g.
sqrt(milli)
.
-
Change unit simplification and unit aliasing to be simpler and more consistent. Units like
%
andmillion
are now simplified unless you explicitly convert your result to one of those units. fend will now also simplify certain combinations of units, such asvolts / ohms
becomingamperes
.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.
-
Rename Windows installer artifacts (MSI files) to also include the version number, e.g.
fend-1.4.0-windows-x64.msi
. -
Replace
nanorand
dependency withrand
, which is better supported and fixes compilation errors on FreeBSD.
- Add
pkgx
package (by @michaelessiet) - Add
x86_64-unknown-linux-musl
binary - Fix terminal issues on some architectures such as MIPS (by @eatradish)
-
Custom units can now be defined in the
~/.config/fend/config.toml
configuration 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, e.g.
\alpha
becomes α (by @Markos-Th09) -
You can now use the
of
operator to write e.g.5% of 100
(by @fa993) -
Add CGS units (by @Markos-Th09)
- Add support for additional imperial and US customary units
- Support 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-source
option. (by @Markos-Th09) - Exchange rates are now available in fend-web (by @Markos-Th09)
- Support complex numbers in many more situations, including trigonometric functions, logarithms, exponentiation, etc. (by @Markos-Th09)
- Add support for unit prefixes for parsecs (e.g.
Mpc
)
- Add crate features to control the TLS implementation: enabling
native-tls
will cause fend to use the operating system's built-in TLS implementation. Therustls
feature, which is enabled by default, will keep the existing native Rust implementation. When both features are disabled, such as when compiling with--no-default-features
, network connectivity will not be available and currency conversions will not work. (by @eatradish) - Add "zł" as an alias for Polish złoty (PLN) (by @twolodzko)
- Add AOSC OS package and installation instructions (by @eatradish)
- Use
windows-sys
instead ofwinapi
- Add Chinese units
jin
andgongjin
(by @eatradish) - Add Xbps (Void Linux) package (by @tranzystorek-io)
- Add MacPorts package (by @herbygillot)
-
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
-
Add a new configuration option
enable-internet-access
(defaults totrue
) -
Add
tbs
unit as an abbreviation for tablespoons -
Add
thou
unit, representing a thousandth of an inch
- Add cup, tablespoon and teaspoon units (by @elcste)
- Add
bin
alias for binary (by @xfnw) - Change the internal implementation of exchange rate handlers (by @SekoiaTree)
- Fix unit test failures on 32-bit systems
-
Add
@no_trailing_newline
attribute, which causes fend to not print a trailing newline after the calculation.$ fend @no_trailing_newline 5+5 10
- Add support for subtracting from dates (e.g.
@2023-01-08 - 5 days
) - Fix some trigonometric functions behaving incorrectly when passing in values with units
-
Add operators for permutations and combinations (by @frectonz)
n permute k
orn nPr k
: compute the number ofk
-permutations ofn
n choose k
orn nCr k
: number ofk
-combinations ofn
-
Add
@noapprox
attribute to hide theapprox.
annotation in the output:> pi approx. 3.1415926535 > @noapprox pi 3.1415926535
-
Add
@plain_number
attribute, 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
-
Add a new date literal syntax, e.g.
@2000-01-01
-
Improve visual feedback when using the Telegram bot (by @miki-tebe)
-
Add new SI prefixes quecca, ronna, ronto and quecto (by @frectonz)
-
Add support for 256 (8-bit) colors in the CLI configuration
-
Change
!debug
to@debug
for consistency and improved shell script interoperability
- Add
and
andor
keywords as alternatives to the&
and|
bitwise operators - Add Homebrew package (by @rhysmdnz)
- Add Chocolatey package (by @dgalbraith)
- Fix incorrect description of command-line arguments in man page (by @mcint)
- Support
_
in fend-web (stores the previous answer) - 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
- Add bitwise operators:
&
: bitwise AND|
: bitwise ORxor
: bitwise XOR (^
is already used for exponentiation)<<
: left shift>>
: right shift
- Automatically download up-to-date currency exchange rates,
e.g. when calculating
10 EUR to USD
- fend can now read directly from files, e.g.
fend calculation.txt
will read and evaluate the contents ofcalculation.txt
. Multiple files can be specified, as well as combinations 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 -- -V
is interpreted as-1 volts
instead of showing the version number - Fix bug where trailing whitespace or comments would result in a parse error
- Add a man page
- 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
)
- Add a
fend-wasm-nodejs
NPM package - Add a Telegram bot
- Improve behaviour of percentages (credit to @Techcable), e.g.
5% * 80kg
is now4 kg
- Add a Markdown-like parsing mode to the WASM API
- Support
kn
forknots
- Add an installer for Windows
- Support
rad
forradians
(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
- Improve CLI colors
- Use Coulomb and Farad for prefixed units like
mC
orµF
- Add
sqmm
unit for square millimeters - Add
point
unit for typographical points (i.e. 1/72 inch) - Improve CLI behavior when pressing Ctrl-C to clear the current line
- 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 Rust 1.59)
- Allow
kmh
andkm/h
for kilometers per hour - Change Planck's constant from
h
toplanck
- Add support for lambda notation
λx.x
(in addition to the previous lambda notations\x.x
,x:x
andx => 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
- 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.toml
for its configuration file, and store history in~/.local/state/fend/history
. You can runfend help
to see which paths fend uses, and override them via theFEND_CONFIG_DIR
andFEND_STATE_DIR
environment variables if necessary. - Colors in the CLI are now enabled by default. They can be disabled via the
enable-colors
config option, or via theNO_COLOR
environment variable.CLICOLOR
andCLICOLOR_FORCE
environment variables are also respected. See https://bixense.com/clicolors/ and https://no-color.org for more info. - Add a
max-history-size
config 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-gnueabihf
andaarch64
architectures.
- Add base names
ternary
andsenary
- Reduce CLI binary sizes
-
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
- Fix minor bug in the
fend-wasm-web
NPM package
- Add
stone
unit - Add initial support for date arithmetic, e.g.
('2020-05-04' to date) + 500 days
- There is now a
fend-wasm-web
NPM package available, built with the--target web
option
- Add basic tab completion support to the CLI interface
- Improve output for
()
types in the CLI and infend-wasm
- Fully support empty statements and trailing semicolons
- Add amp hour abbreviation (e.g.
mAh
) - Improve error message when attempting to convert between incompatible units
-
Add support for D&D-style dice syntax. For example,
d6
refers 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
lux
unit definition -
Remove the
->
conversion syntax: useto
instead
- Support modulo with arbitrarily large integers
- Add a config option to use
C
andF
as coulomb and farad instead of degrees celsius and degrees fahrenheit - Add more units:
horsepower
,lumen
,lux
,decare
etc.
- Add more units:
atmosphere
,mmHg
,inHg
,dB
,mil
and more - Support variables over multiple statements in the wasm API
- Add variables and multiple statements (e.g.
a = 4; b = 10; a * b
is40
) - Add
mixed_frac
as an alias formixed_fraction
- Support the
£
symbol for GBP - Allow
$
and£
before the associated number, e.g.$100/4
is$25
- Add
k
,M
,G
andT
suffixes for numbers (e.g.5k
is5000
) - Add a modulo operator
mod
(e.g.5 mod 2
is1
) - Improve error messages for invalid unit conversions
- Add the golden ratio constant phi ϕ (
phi
isapprox. 1.6180339886
) - Fix incorrect currency exchange rates
- Add
true
,false
, and anot()
function - Add
sqm
andsqft
units for square meters and square feet respectively
- Add support for Unicode operators, such as ✕ or ÷
- Add color customization to the command-line interface by editing the
config.toml
file. Refer to the defaultconfig.toml
file here.
-
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
help
to find out where it is stored. Theconfig.toml
file 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 = true
first. -
Added a
conjugate
function that computes the complex conjugate of a number: e.g.conjugate(i)
is-i
. -
Improve consistency around error messages
- 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
b
as shorthand for bits (including e.g.Gb/s
) - Remove the
0d
number prefix
- Add °C and °F (including temperature conversions)
- Automatically simplify units in some calculations (e.g.
100 km/hr * 36 seconds
becomes1 km
) - Add initial support for objects (try e.g.
mass of earth
) - Add
square
andcubic
functions - Add hectares and acres
This build was only released on NPM.
- Fix NPM package
- Improve debug representation (using e.g.
!debug 1
)
- Allow leading zeroes for decimal numbers
- Allow upper-case "E" for exponential numbers (e.g.
1E3
is1000
) - Add
in
as an alias forto
(so you can now write3.14 in binary
) - Add
log()
function as shorthand forlog10()
- Fix
kWh
unit definition
- Include
LICENSE.md
files as part of the package on crates.io
- Add
version
command to get the current fend version - Support
-sin pi
and3 sin pi
without parentheses - Support function inverses: e.g.
sin^-1
becomesasin
- Add
to sf
to convert numbers to a fixed number of significant figures - Make many calculations involving
sin
andcos
exact - Add
tau
(τ
), equal to2π
- Add Yi- and Zi- binary prefixes
- Use decimal approximations instead of fractions by default
x to exact
will now convertx
to an exact representation whenever possible, including using multiples of π- Add
cis
as a shorthand forcos θ + i * (sin θ)
- Ensure that approximate numbers are always marked as such
- Fix a bug involving sin/cos/tan of negative numbers
- Make some calculations involving pi exact
- Fix parsing of recurring decimals in bases other than 10
- Support outputting mixed fractions (implicitly or via
to mixed_fraction
) - Support unmatched parentheses (e.g.
2+3)*(1+2
is15
) - 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
- Add support for lambda functions (e.g.
\x.x
) - Change precedence of
to
andas
- Add live CLI output
- Add the GNU units database, containing several thousand unit definitions
- 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
)
- Use correct singular/plural unit names
- Base conversions using
to
- Make exponents in other bases more consistent
- Allow leading zeroes for non-decimal numbers
- Support interrupting an ongoing calculation with Ctrl-C
- Save history continuously instead of only on program exit
- Fix parsing of
log10()
andlog2()
- Add factorial operator (
!
)
Initial release:
- 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