dntk

Travis CI v2.0.4 crates docker license platform

dntk is command line's Interactive calculator, GNU bc wrapper.
asciicast

✔︎ dntk means calculator in a japanese.
✔︎ dntk is gnu bc wrapper. so, syntax is equal to gnu bc. learn syntax more
✔︎ dntk is a NATIVE The Rust Programming Language application.
✔︎ dntk write color means,

color means
cyan can caluclate & can output
megenta can't caluclate, can't output
yellow danger input char, output warning

Current dntk's version: v2.0.4

Download Page: https://github.com/nnao45/dntk/releases/latest

Install

Mac

bash $ brew install nnao45/dntk/dntk

Linux

bash $ wget https://github.com/nnao45/dntk/releases/download/v2.0.4/dntk-v2.0.4-x86_64-unknown-linux-gnu.zip $ unzip dntk-v2.0.4-x86_64-unknown-linux-gnu.zip

if can't move, try... bash $ wget https://github.com/nnao45/dntk/releases/download/v2.0.4/dntk-v2.0.4-x86_64-unknown-linux-musl.zip $ unzip dntk-v2.0.4-x86_64-unknown-linux-musl.zip

From Rust source

bash $ cargo install dntk

zplug

bash $ zplug 'nnao45/dntk', as:command, from:gh-r

Docker

Can use dntk docker image,
Look!! Very light weight!!🚀

bash $ docker images nnao45/dntk REPOSITORY TAG IMAGE ID CREATED SIZE nnao45/dntk latest 3a37b5d989b5 2 hours ago 10.5MB

And run,

bash $ docker run -it --rm nnao45/dntk:latest

And...

bash $ echo 'alias bc=dntk' >> ~/.bashrc $ echo 'alias bc=dntk' >> ~/.zshrc All OK!! 😎

Options

``` ./target/release/dntk --help dntk 2.0.3 nnao45 n4sekai5y@gmail.com Command line's Interactive calculator, GNU bc wrapper.

USAGE: dntk [FLAGS] [OPTIONS]

FLAGS: -h, --help Prints help information -V, --version Prints version information -w, --white Set White color in a output

OPTIONS: -s, --scale Number of truncated after the decimal point ```

Keybind

key feature
[ cursor move to left
] cursor move to right
0~9 Sendkey this number
Esc, Ctrl+C, Enter Finish dntk app

Basic Operation

key feature
+ plus
- minus
* multiplication
/ division
^ exponentiation

Operation for Logical

key feature
! boolean, relational
| boolean
& boolean
> relational
< relational
= relational

Using Function

you can use under function.

function key feature
(x) () Simple round bracket
sin(x) s() Sin of trigonometric function
cos(x) c() Cosin of trigonometric function
atan(x) a() Tangent of inverse trigonometric function
log(x) l() Logarithm function
exp(x) e() Exponential function
j(n,x) j() The n-order Bessel function

more detail 👉 https://www.gnu.org/software/bc/manual/html_mono/bc.html

clean buffer

if you want to clean buffer, very easy, type r

asciicast

Pipe Use...

bash $ echo "123 * 2" | dntk 246 behave, like bc ☺️

Have a nice rust hacking days:sparkles::wink:

Writer & License

dntk was writed by nnao45 (WORK:Infrastructure Engineer, Twitter:@nnao45, MAIL:n4sekai5y@gmail.com).
This software is released under the MIT License, see LICENSE.