Skip to content

0x1af2aec8f957/dart-calculate

Repository files navigation

pub

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages