calculate 2.0.0 copy "calculate: ^2.0.0" to clipboard
calculate: ^2.0.0 copied to clipboard

This project enable to make computations on decimal numbers without loosing precision like double operations.

Dart Calculate

处理dart double计算精度丢失问题. 从V1.0.0开始。库内代码计算使用dart-decimal,本库仅提供逆波兰表达式实现。

For instance :
import 'package:calculate';

print(compute('0.1 0.1 *'));

Usage

  • 编辑pubspec.yaml文件
dependencies:
  calculate: "0.0.4"
  • 获取包
pub get
  • 引入你的项目
import 'package:calculate/calculate.dart';
如果你不习惯逆波兰表达式,推荐使用dart-decimal处理精度问题。

参考链接

  1. Reverse Polish notation (RPN).
  2. Shunting-yard algorithm
2
likes
130
pub points
23%
popularity

Publisher

unverified uploader

This project enable to make computations on decimal numbers without loosing precision like double operations.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

decimal

More

Packages that depend on calculate