百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
E

eva

> 开发工具
开源

一个计算器 REPL,类似于 bc(1)

910 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

一个计算器 REPL,类似于 bc(1)

eva

简单的计算器 REPL,类似于 bc(1),具有语法高亮和持久历史记录

安装

  • Homebrew
bash
$ brew install eva
  • crates.io
bash
$ cargo install eva
  • 手册
bash
$ git clone https://github.com/nerdypepper/eva
$ cd eva
$ cargo run

使用方法

bash
eva 0.3.1
NerdyPepper 
Calculator REPL similar to bc(1)

USAGE:
    eva [OPTIONS] [INPUT]

ARGS:
        Optional expression string to run eva in command mode

OPTIONS:
    -b, --base     Radix of calculation output (1 - 36) [default: 10]
    -f, --fix        Number of decimal places in output (1 - 64) [default: 10]
    -h, --help            Print help information
    -r, --radian          Use radian mode
    -V, --version         Print version information

输入一个表达式并按 Enter 键,然后重复此操作。

bash
> 1 + sin(30)
1.5
> floor(sqrt(3^2 + 5^2))
> 5sin(45) + cos(0)
4.53553

更新

  • crates.io
bash
$ cargo install eva --force
  • 手册
bash
$ cargo install --force --path /path/to/eva

运算符

  • 二元运算符: + - * / ^ **
  • 单元运算符: + -

常量

Rust标准库中的一些常量。

e      pi

示例:

pi * 5^2  # πr²

函数

所有三角函数都期望以度为单位输入。

1 argument:
sin    cos     tan    csc    sec    cot    sinh   cosh   tanh
asin   acos    atan   acsc   asec   acot   ln     log2   log10
sqrt   ceil    floor  abs

2 arguments:
log    nroot

deg(x) - convert x to degrees
rad(x) - convert x to radians

示例:

sqrt(sin(30)) # parentheses are mandatory for functions

log10100      # no
log10(100)    # yes

log(1, 10)    # function with two arguments

生活质量功能

  • 自动插入 * 运算符
>12sin(45(2))             # 12 * sin(45 * (2))
  • 自动平衡括号

5 12 6

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rustcalculatorclihacktoberfestrust

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类开发工具
定价开源

> 相关工具

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具