rational 0.3.6

  • Readme
  • Changelog
  • Example
  • Installing
  • 82

Dart Rational #

Build Status

This project enable to make computations on rational numbers.

Usage #

To use this library in your code :

  • add a dependency in your pubspec.yaml :
dependencies:
  rational: ^0.3.0

Rational numbers #

  • add import in your dart code :
import 'package:rational/rational.dart';
  • Start computing using Rational.parse('1.23'), Rational(BigInt.from(12), BigInt.from(7)) or Rational.fromInt(12, 7).

License #

Apache 2.0

0.3.6 (2019-09-02) #

  • add Rational.pow.

0.3.5 (2019-07-29) #

  • add Rational.zero and Rational.one.
  • add Rational.inverse.

0.3.4 (2019-04-25) #

0.3.3 (2019-04-08) #

0.3.2 (2019-03-19) #

0.3.1 (2018-07-24) #

  • migration to Dart 2.

0.3.0 (2018-07-10) #

  • allow parsing of 1..
  • make Rational.parse a factory constructor.

0.2.0 (2018-03-15) #

  • move to Dart SDK 2.0
  • remove BigInt class
  • use BigInt provided by dart:core

v0.1.11 (2017-06-16) #

  • add types.

v0.1.10+1 (2017-02-19) #

v0.1.10 (2017-02-19) #

v0.1.9 (2016-06-10) #

v0.1.8+1 (2014-10-29) #

  • fix a bug for Rational.precision on negative number.

v0.1.8 (2014-10-29) #

  • fix bugs with dart2js
  • add Rational.signum
  • add Rational.hasFinitePrecision
  • add Rational.precision
  • add Rational.scale

v0.1.7 (2014-10-07) #

  • Rational.parse accepts strings in scientific notation (eg. 1.5e-3).

v0.1.6 (2014-10-06) #

  • BigInt.parse accepts an optional prepending + for positive integers.

Semantic Version Conventions #

http://semver.org/

  • Stable: All even numbered minor versions are considered API stable: i.e.: v1.0.x, v1.2.x, and so on.
  • Development: All odd numbered minor versions are considered API unstable: i.e.: v0.9.x, v1.1.x, and so on.

example/example.dart

import 'package:rational/rational.dart';

void main() {
  print(Rational.parse('0.1') + Rational.fromInt(1, 4));
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  rational: ^0.3.6

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:rational/rational.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
66
Health:
Code health derived from static analysis. [more]
97
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
82
Learn more about scoring.

We analyzed this package on Oct 16, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:rational/rational.dart.

Health suggestions

Fix lib/rational.dart. (-3.45 points)

Analysis of lib/rational.dart reported 7 hints, including:

line 123 col 7: DO use curly braces for all flow control structures.

line 125 col 7: DO use curly braces for all flow control structures.

line 277 col 30: DO use curly braces for all flow control structures.

line 278 col 30: DO use curly braces for all flow control structures.

line 295 col 36: DO use curly braces for all flow control structures.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.66.0 <3.0.0
Dev dependencies
test ^1.2.0