rational
The rational package allows you to deal with rational numbers.
2.2.3
681K downloads/mo
#433 most downloaded on pub.dev
a14n/dart-rational
What this package is like to depend on
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
0 releases in the last 12 months
see the full history below
Release timeline
39 releases · Apr 2013 to Jun 2024Releases
latest 39-
2.2.302 Jun 2024Release notes
Open source →- Improve performance by working around the issue BigInt.gcd() is really slow with a custom
gcdimplementation based on Euclidean algorithm.
- Improve performance by working around the issue BigInt.gcd() is really slow with a custom
-
2.2.207 Dec 2022 -
2.2.124 Nov 2022 -
2.2.020 Mar 2022Release notes
Open source →- Explicitly throw an
ArgumentErrorwhen a Rational is created with a zero denominator.
- Explicitly throw an
-
2.1.027 Jan 2022 -
2.0.029 Nov 2021Release notes
Open source →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 aBigInt. If you need aRationalyou can convert theBigInttoRationalwithbigint.toRational().- Removal of
toDecimalString(). You can replace it withrational.toDecimal(scaleOnInfinitePrecision: 10).toString()using the decimal package. - Removal of
isNaNgetter. It was always returningfalse. - Removal of
isInfinitegetter. It was always returningfalse. - Removal of
isNegativegetter. You can replace it withrational < Rational.zero. - Removal of
roundToDouble(),floorToDouble(),ceilToDouble(),truncateToDouble(). You can replace them byround().toDouble(),floor().toDouble(),ceil().toDouble(),truncate().toDouble(). - Removal of
toInt(). You can replace it withrational.toBigInt().toInt(). - Removal of
hasFinitePrecisiongetter. This getter (provided as extension onRational) is now part of the decimal package. - Removal of
precisionandscalegetters. They was only available on rational returningtrueonhasFinitePrecision(ie. decimal numbers). You can replace them withrational.toDecimal().precisionandrational.toDecimal().scaleusing the decimal package. - Removal of
toStringAsFixed,toStringAsExponentialandtoStringAsPrecision. You can replace them withrational.toDecimal(scaleOnInfinitePrecision: xxx).toStringAsFixed,rational.toDecimal(scaleOnInfinitePrecision: xxx).toStringAsExponentialandrational.toDecimal(scaleOnInfinitePrecision: xxx).toStringAsPrecisionusing the decimal package.
Other changes:
- Add extension method
toRational()onint. - Add extension method
toRational()onBigInt.
-
1.2.128 May 2021Release notes
Open source →- Improve performance of several methods by working around the issue BigInt.gcd() is really slow with a custom
gcdimplementation based on Euclidean algorithm.
- Improve performance of several methods by working around the issue BigInt.gcd() is really slow with a custom
-
1.2.028 May 2021Release notes
Open source →- Improve parsing of number with big exponent part. However the exponent part must now be parsable as an int.
-
1.1.029 Apr 2021 -
1.1.0+129 Apr 2021 -
1.0.025 Feb 2021 -
1.0.0-nullsafety27 Nov 2020 pre-release -
0.3.830 Jan 2020 -
0.3.721 Dec 2019 -
0.3.603 Sep 2019 -
0.3.529 Jul 2019 -
0.3.425 Apr 2019 -
0.3.308 Apr 2019 -
0.3.219 Mar 2019 -
0.3.124 Jul 2018 -
0.3.010 Jul 2018 -
0.2.015 Mar 2018Release notes
Open source →- move to Dart SDK 2.0
- remove
BigIntclass - use
BigIntprovided bydart:core
-
0.1.1116 Jun 2017 -
0.1.1019 Feb 2017 -
0.1.10+119 Feb 2017 -
0.1.910 Jun 2016 -
0.1.829 Oct 2014Release notes
Open source →- fix bugs with dart2js
- add
Rational.signum - add
Rational.hasFinitePrecision - add
Rational.precision - add
Rational.scale
-
0.1.8+129 Oct 2014 -
0.1.707 Oct 2014 -
0.1.606 Oct 2014 -
0.1.525 Jul 2014Nothing published for this version
-
0.1.411 Mar 2014Nothing published for this version
-
0.1.328 Nov 2013Nothing published for this version
-
0.1.222 Nov 2013Nothing published for this version
-
0.1.121 Nov 2013Nothing published for this version
-
0.1.020 Nov 2013Nothing published for this version
-
0.0.609 Nov 2013Nothing published for this version
-
0.0.517 Apr 2013Nothing published for this version
-
0.0.416 Apr 2013Nothing published for this version