Releases: EricRovell/rational
Releases · EricRovell/rational
v1.0.1: Update dependencies
1.0.1 (2024-03-22)
- [chore]: update dependencies and building processes;
- [chore]: bundle type definitions into one file;
v1.0.0: First Major Release
- [breaking]:
.toDecimalString()
and.toFractionString()
is removed in favor for improved.toString()
method to not dublicate the functionality; - [feat]: expose input types for a user;
- [feat]: improve
.valueOf(places?)
method with optional argument to round the decimal approximation; - [feat]: implement
.continued
for continued fraction representation;
Fixed ESM Module path
- [fix]: Incorrect ESM Module path;
Test coverage improvements and fixes
- [improvement]: Improved test coverage to 99.63%;
- [fix]: Invalid results for exponentiation;
- [fix]: Invalid type handling for repeating decimal inputs;
More math, representation, input types and fixes
- [feature]: new type of input, degrees value object;
- [feature]: new type of input, repeating decimal object;
- [feature]:
.repeating
property for repeating decimals checks; - [fix]: invalid
.proper
property check for negative rationals; - [feature]:
.toDecimalString(places)
method for transforming rational numbers into decimal strings. Handles repeating decimals; - [feature]:
.toFractionString()
method for transforming rational numbers into fractional strings. Differs from.toString()
by producing proper fractions by default; - [fix]:
.integralPart
invalid calculation for negative values; - [feature]:
.gcd()
method for calculating GCD of two rational numbers; - [feature]:
.lcm()
method for calculating LCM of two rational numbers; - [feature]:
.divisible()
method for divisibility checks; - [feature]:
.valueOf()
method for transformation into decimal and coercion;
New input types and more math operations
- [improvement]: fractional string input can include integral part separated with whitespace: "1 2/3";
- [feature]: new type of input, degrees/minutes/seconds string: (1.23'45'');
- [feature]:
.mod()
method for calculating the modulo of two rational numbers; - [feature]:
.mathmod()
method for calculating the mathematical correct modulo of two rational numbers; - [feature]:
.pow()
method for exponentiation of rational numbers.
Parsing improvements
- [feature]: new type of input, string in a form of fraction ("1/2");
- [feature]: new type of input, string in a form of repeating decimal (".(1)", "1.23(456)");
- [improvement]: fractional object type extended, now the parser handles the integral parts of the fraction;
Rounding, absolute value. fixed types and CJS/ESM support
- [improvement]: CommonJS support;
- [feature]:
.abs
property to get absolute value of the rational number; - [feature]: comparison between rational numbers via
.compare(rational)
method; - [feature]:
.round()
,.ceil()
, andfloor()
method to perform round operations on rational numbers; - [fix]: package types inferred properly;
v0.1.0: Basic API
add: updated getting started && badges