| Crates.io | dntk |
| lib.rs | dntk |
| version | 3.1.1 |
| created_at | 2019-05-25 12:04:25.054618+00 |
| updated_at | 2025-10-19 12:45:08.550951+00 |
| description | Command line's multi-platform interactive calculator, GNU bc wrapper. |
| homepage | https://github.com/nnao45/dntk |
| repository | https://github.com/nnao45/dntk |
| max_upload_size | |
| id | 136901 |
| size | 243,922 |
dntk is command line's multi-platform Interactive calculator with bc-compatible syntax and high-precision arithmetic.

✔︎ dntk means calculator in a japanese.
✔︎ dntk is bc-compatible calculator with bc-style configurable precision powered by dashu-decimal (no external bc required!)
✔︎ dntk syntax is compatible with GNU bc. learn syntax more
✔︎ dntk is a NATIVE The Rust Programming Language application.
✔︎ dntk can move cursor, can delete char, can refresh buffer.
✔︎ dntk provides accurate decimal arithmetic without floating-point errors.
Download Page: https://github.com/nnao45/dntk/releases/latest
dashu-decimal for arbitrary-precision decimals with predictable bc semantics1 + 0.7 = 1.7 (not 1.69999...)1/3 = .33333333333333333333fasteval + dashu-decimalsin, cos, tan, …), logarithms (log, ln, log10, …), powers (pow, sqrt, cbrt), aggregations (min, max, hypot) plus length, scale, and Bessel j(n,x) — short aliases like s(), c(), a(), l(), e() still worki, e.g. 1+2i, (4-3i)/(1+2i), or abs(3+4i)[[1,2],[3,4]] * [[5,6],[7,8]]1i, -2i) so regular bc identifiers like i keep their original meaning| color | means |
| cyan | can caluclate & can output |
| megenta | can't caluclate, can't output |
| yellow | danger input char, output warning |
| green | clean buffer message |
dntk support multi-platform 😊 mac, linux, freebsd, and windows!!!
$ brew install nnao45/dntk/dntk
$ wget https://github.com/nnao45/dntk/releases/download/v3.1.1/dntk-v3.1.1-x86_64-unknown-linux-musl.zip
$ unzip dntk-v3.1.1-x86_64-unknown-linux-musl.zip
$ wget https://github.com/nnao45/dntk/releases/download/v3.1.1/dntk-v3.1.1-x86_64-pc-windows-msvc.zip
$ unzip dntk-v3.1.1-x86_64-pc-windows-msvc.zip
$ wget https://github.com/nnao45/dntk/releases/download/v3.1.1/dntk-v3.1.1-x86_64-unknown-freebsd.zip
$ unzip dntk-v3.1.1-x86_64-unknown-freebsd.zip
$ cargo install dntk
$ zplug 'nnao45/dntk', as:command, from:gh-r
Can use dntk docker image,
Look!! Very light weight!!🚀
$ docker images nnao45/dntk
REPOSITORY TAG IMAGE ID CREATED SIZE
nnao45/dntk latest 3a37b5d989b5 2 hours ago 10.5MB
And run,
$ docker run -it --rm nnao45/dntk:latest
$ echo 'alias bc=dntk' >> ~/.bashrc
$ echo 'alias bc=dntk' >> ~/.zshrc
All OK!! 😎
❯❯❯ dntk -h
Command line's multi-platform interactive calculator with high-precision arithmetic.
USAGE:
dntk [FLAGS] [OPTIONS]
FLAGS:
-h, --help Prints help information
--once Run at only once
-q, --quiet No print information message
--show-limits Print the local limits
-V, --version Prints version information
-w, --white Set White color in a output
OPTIONS:
-i, --inject <inject> Pre-run inject statement to the dntk [default: ]
-s, --scale <scale> Number of decimal places (max 28) [default: 20]
Note: --bc-path option has been removed as dntk no longer requires external bc command!
$ echo "123 * 2" | dntk
246
behave, like bc ☺️
$ echo '( 1 + 2 + 3 + 4 + 51 ) / sqrt( 123 / 3 )' | pbcopy
$ pbpaste | dntk
9.52659947520496999698
No additional setup required! 🎉
dntk works out of the box on Windows without installing bc.exe. Just download and run!

Older versions required bc.exe installation. If you're using an older version:
$ choco install gnuwin
Recommendation: Upgrade to the latest version for better Windows support!
| key | feature |
| [, ← | cursor move to left |
| ], → | cursor move to right |
| 0~9 | Sendkey this number |
| Ctrl+C, Enter | Finish dntk app |
| Delete, Backspace | Delete current char |
| @ | Clean buffer |
| key | feature |
| + | plus |
| - | minus |
| * | multiplication |
| / | division |
| ^ | exponentiation |
| % | remainder |
| key | feature |
| ! | boolean, relational |
| | | boolean |
| & | boolean |
| > | relational |
| < | relational |
| = | relational |
dntk ships the bc classics plus a broad math toolkit:
s(x) → sin(x), c(x) → cos(x), a(x) → atan(x), l(x) → ln(x), e(x) → exp(x)sqrt(x), cbrt(x), pow(x,y)ln(x), log10(x), log2(x), log(base,value) (arbitrary base), exp(x), expm1(x)sin, cos, tan, asin, acos, atan, atan2sinh, cosh, tanh, asinh, acosh, atanhabs, sign, floor, ceil, trunc, roundmin(...), max(...), hypot(x,y)length(x) (digit count), scale(x) (fractional digits), obase= for base-2〜36 outputrand() / rand(n), srand(seed), j(n,x) Bessel (integer order n)more detail 👉 https://www.gnu.org/software/bc/manual/html_mono/bc.html
dntk uses a hybrid approach for optimal performance and precision:
fasteval - Fast and lightweight expression parserrust_decimal - 28-digit decimal precision| Calculator | Precision | Example: 1+0.7 | Example: 1/3 (20 digits) |
|---|---|---|---|
| bc | 20 digits (default) | 1.7 | .33333333333333333333 |
| dntk (old) | ~15 digits (f64) | 1.69999... ❌ | .33333333333333331483 ❌ |
| dntk (new) | 28 digits | 1.7 ✅ | .33333333333333333333 ✅ |
fasteval - Expression evaluationrust_decimal - High-precision decimal arithmetic (up to 28 digits)Previous versions wrapped the external bc command. The new version:
$ make
$ make docker-build
Always Welcome!! 😄
Have a nice rust hacking days:sparkles::wink:
dntk was writed by nnao45 (WORK:Infrastructure Engineer, Twitter:@nnao45, MAIL:n4sekai5y@gmail.com).
This software is released under the MIT License, see LICENSE.