pimath 0.0.77 → 0.0.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/pi.js CHANGED
@@ -4063,7 +4063,9 @@ class Fraction {
4063
4063
  else {
4064
4064
  // The given value is a float number
4065
4065
  // Get the number of decimals after the float sign
4066
- let p = (value.toString()).split('.')[1].length;
4066
+ let [unit, decimal] = (value.toString()).split('.');
4067
+ let p = decimal.length;
4068
+ // Detect if the decimal part is periodic or not...
4067
4069
  // Transform the float number in two integer
4068
4070
  if (denominatorOrPeriodic === undefined) {
4069
4071
  this._numerator = value * Math.pow(10, p);
@@ -6563,6 +6565,18 @@ class Numeric {
6563
6565
  }
6564
6566
  return value;
6565
6567
  }
6568
+ static periodic(value) {
6569
+ if (Number.isSafeInteger(value)) {
6570
+ return 0;
6571
+ }
6572
+ // Assume it's with decimal.
6573
+ let decimal = (value.toString()).split('.')[0];
6574
+ // The decimal part is limited
6575
+ if (decimal.length < 10) {
6576
+ return 0;
6577
+ }
6578
+ // Find the periodic if it exists.
6579
+ }
6566
6580
  }
6567
6581
  exports.Numeric = Numeric;
6568
6582
 
@@ -6629,7 +6643,7 @@ var Random;
6629
6643
  }
6630
6644
  Random.item = item;
6631
6645
  function shuffle(arr) {
6632
- rndHelpers_1.rndHelpers.shuffleArray(arr);
6646
+ return rndHelpers_1.rndHelpers.shuffleArray(arr);
6633
6647
  }
6634
6648
  Random.shuffle = shuffle;
6635
6649
  })(Random = exports.Random || (exports.Random = {}));