NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #469 most downloaded on pub.dev
The rational package allows you to deal with rational numbers.
Last release 2 years ago
no release in 18 months
Release timing varies
gaps range from 2 weeks to 1.5 years
Most releases are documented
notes for 29 of 38 stable releases
Nothing withdrawn
no release was ever pulled
13 years old
39 releases · first in 2013
Improve performance by working around the issue BigInt.gcd() is really slow with a custom gcd implementation based on Euclidean algorithm.
gcd implementation based on Euclidean algorithm.Update files according to license.
One column per quarter.
Update license file to be recognized by pub.dev.
Explicitly throw an ArgumentError when a Rational is created with a zero denominator.
ArgumentError when a Rational is created with a zero denominator.- Add Rational.tryParse.
Rational.tryParse.It introduces several breaking changes.
The goal of this version is to move several decimal methods back to the decimal package and to have sharper types on the API.
It introduces several breaking changes.
~/, round(), floor(), ceil(), truncate() now return a BigInt. If you need a Rational you can convert the BigInt to Rational with bigint.toRational().toDecimalString(). You can replace it with rational.toDecimal(scaleOnInfinitePrecision: 10).toString() using the decimal package.isNaN getter. It was always returning false.isInfinite getter. It was always returning false.isNegative getter. You can replace it with rational < Rational.zero.roundToDouble(), floorToDouble(), ceilToDouble(), truncateToDouble(). You can replace them by round().toDouble(), floor().toDouble(), ceil().toDouble(), truncate().toDouble().toInt(). You can replace it with rational.toBigInt().toInt().hasFinitePrecision getter. This getter (provided as extension on Rational) is now part of the decimal package.precision and scale getters. They was only available on rational returning true on hasFinitePrecision (ie. decimal numbers). You can replace them with rational.toDecimal().precision and rational.toDecimal().scale using the decimal package.toStringAsFixed, toStringAsExponential and toStringAsPrecision. You can replace them with rational.toDecimal(scaleOnInfinitePrecision: xxx).toStringAsFixed,rational.toDecimal(scaleOnInfinitePrecision: xxx).toStringAsExponential and rational.toDecimal(scaleOnInfinitePrecision: xxx).toStringAsPrecision using the decimal package.Other changes:
toRational() on int.toRational() on BigInt.Improve performance of several methods by working around the issue BigInt.gcd() is really slow with a custom gcd implementation based on Euclidean alg
gcd implementation based on Euclidean algorithm.Improve parsing of number with big exponent part. However the exponent part must now be parsable as an int.
Allow negative value as exponent of pow.
pow.- Fix the doc of pow.
pow.- Stable null safety release.
- Migrate to nullsafety.
- Improve pub score.
Replace gcd implementation with dart:core's.
- add Rational.pow.
Rational.pow.add Rational.zero and Rational.one.
Rational.zero and Rational.one.Rational.inverse.allow numbers starting with dot.
- fix issue with `signnum`.
fix issue with `toStringAsPrecision`.
- migration to Dart 2.
make Rational.parse a factory constructor.
1..Rational.parse a factory constructor.use BigInt provided by dart:core
BigInt classBigInt provided by dart:core- add types.
fix bug on `operator %` with negative values.
fix bug on `operator %` with negative values on browser.
operator % with negative values on browser.fix a bug on `BigInt.toDouble`.
add Rational.hasFinitePrecision
Rational.signumRational.hasFinitePrecisionRational.precisionRational.scalefix a bug for Rational.precision on negative number.
Rational.precision on negative number.Rational.parse accepts strings in scientific notation (eg. 1.5e-3).
Rational.parse accepts strings in scientific notation (eg. 1.5e-3).BigInt.parse accepts an optional prepending + for positive integers.
BigInt.parse accepts an optional prepending + for positive integers.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →