powiaina_num.js 0.1.2 → 0.1.4

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/PowiainaNum.d.ts CHANGED
@@ -118,16 +118,41 @@ export default class PowiainaNum {
118
118
 
119
119
  static hyper(z: PowiainaNumSource): (x:PowiainaNumSource,y:PowiainaNumSource)=>PowiainaNum;
120
120
 
121
+
121
122
  expansion(other: PowiainaNumSource): PowiainaNum;
122
123
  static expansion(x: PowiainaNumSource, other: PowiainaNumSource): PowiainaNum;
123
124
  eps(other: PowiainaNumSource): PowiainaNum;
124
125
  static eps(x: PowiainaNumSource, other: PowiainaNumSource): PowiainaNum;
126
+
127
+ multiExpansion(other: PowiainaNumSource): PowiainaNum;
128
+ static multiExpansion(x: PowiainaNumSource, other: PowiainaNumSource): PowiainaNum;
129
+ mulEps(other: PowiainaNumSource): PowiainaNum;
130
+ static mulEps(x: PowiainaNumSource, other: PowiainaNumSource): PowiainaNum;
131
+
132
+
133
+ powerExpansion(other: PowiainaNumSource): PowiainaNum;
134
+ static powerExpansion(x: PowiainaNumSource, other: PowiainaNumSource): PowiainaNum;
135
+ powEps(other: PowiainaNumSource): PowiainaNum;
136
+ static powEps(x: PowiainaNumSource, other: PowiainaNumSource): PowiainaNum;
137
+
138
+ static expansionArrow(other: PowiainaNumSource, array: PowiainaNumSource):PowiainaNum;
139
+ static epsArrow(other: PowiainaNumSource, array: PowiainaNumSource):PowiainaNum;
140
+
141
+
142
+ explosion(other: PowiainaNumSource): PowiainaNum;
143
+ static explosion(x: PowiainaNumSource, other: PowiainaNumSource): PowiainaNum;
144
+ els(other: PowiainaNumSource): PowiainaNum;
145
+ static els(x: PowiainaNumSource, other: PowiainaNumSource): PowiainaNum;
125
146
 
126
147
  compareTo(other: PowiainaNumSource): -1|0|1;
127
148
  cmp(other: PowiainaNumSource): -1|0|1;
128
149
  static compareTo(x: PowiainaNumSource,y: PowiainaNumSource): -1|0|1;
129
150
  static cmp(x: PowiainaNumSource, y: PowiainaNumSource): -1|0|1;
130
151
 
152
+ static explosionArrow(other: PowiainaNumSource, array: PowiainaNumSource):PowiainaNum;
153
+ static elsArrow(other: PowiainaNumSource, array: PowiainaNumSource):PowiainaNum;
154
+
155
+
131
156
  isInteger(): boolean;
132
157
  isint(): boolean;
133
158
  static isInteger(x: PowiainaNumSource): boolean;
@@ -700,37 +700,6 @@
700
700
  }
701
701
  return r.normalize();
702
702
  }
703
- Q.expansionArrow = Q.epsArrow = function (x, arrow) {
704
- other = new PowiainaNum(x)
705
- arrow = new PowiainaNum(arrow)
706
- if (other.lte(PowiainaNum.ZERO) || !other.isint()) return PowiainaNum.NaN.clone();
707
- if (!arrow.isint() || arrow.lt(1)) return PowiainaNum.NaN.clone();
708
- if (other.eq(PowiainaNum.ONE)) return t.clone();
709
- var r;
710
- if (arrow.lt(MAX_SAFE_INTEGER)) {
711
- if (other.gt("l0 s1 a[10000000000,[" + (arrow.toNumber().toString()) + "," + (MAX_SAFE_INTEGER - 1).toString() + ",1,1]]")) {
712
- return other.clone();
713
- }
714
- else if (other.gt(PowiainaNum.MAX_SAFE_INTEGER)) {
715
- r = PowiainaNum()
716
-
717
- r.array = []
718
- r.array.push(...other.array);
719
- r.array.push([arrow.toNumber(), 1, 2, 1]);
720
-
721
- } else {
722
- r = PowiainaNum()
723
-
724
- r.array = [10]
725
- r.array.push([arrow.toNumber() - 1, other.toNumber() - 1, 2, 1]);
726
-
727
- }
728
- } else {
729
- r = PowiainaNum(arrow)
730
- r.array.push(["x", 1, 2, 1]);
731
- }
732
- return r.normalize();
733
- }
734
703
  Q.multiExpansion = Q.mulEps = function (x, other) {
735
704
  return PowiainaNum(x).multiExpansion(other);
736
705
  }
@@ -763,6 +732,37 @@
763
732
  Q.powerExpansion = Q.powEps = function (x, other) {
764
733
  return PowiainaNum(x).powerExpansion(other);
765
734
  }
735
+ Q.expansionArrow = Q.epsArrow = function (x, arrow) {
736
+ var other = new PowiainaNum(x)
737
+ var arrow = new PowiainaNum(arrow)
738
+ if (other.lte(PowiainaNum.ZERO) || !other.isint()) return PowiainaNum.NaN.clone();
739
+ if (!arrow.isint() || arrow.lt(1)) return PowiainaNum.NaN.clone();
740
+ if (other.eq(PowiainaNum.ONE)) return t.clone();
741
+ var r;
742
+ if (arrow.lt(MAX_SAFE_INTEGER)) {
743
+ if (other.gt("l0 s1 a[10000000000,[" + (arrow.toNumber().toString()) + "," + (MAX_SAFE_INTEGER - 1).toString() + ",2,1]]")) {
744
+ return other.clone();
745
+ }
746
+ else if (other.gt(PowiainaNum.MAX_SAFE_INTEGER)) {
747
+ r = PowiainaNum()
748
+
749
+ r.array = []
750
+ r.array.push(...other.array);
751
+ r.array.push([arrow.toNumber(), 1, 2, 1]);
752
+
753
+ } else {
754
+ r = PowiainaNum()
755
+
756
+ r.array = [10]
757
+ r.array.push([arrow.toNumber() - 1, other.toNumber() - 1, 2, 1]);
758
+
759
+ }
760
+ } else {
761
+ r = PowiainaNum(arrow)
762
+ r.array.push(["x", 1, 2, 1]);
763
+ }
764
+ return r.normalize();
765
+ }
766
766
 
767
767
  //#endregion
768
768
 
@@ -797,6 +797,37 @@
797
797
  Q.explosion = P.els = function (x, other) {
798
798
  return PowiainaNum(x).explosion(other);
799
799
  }
800
+ Q.explosionArrow = Q.elsArrow = function (x, arrow) {
801
+ var other = new PowiainaNum(x)
802
+ var arrow = new PowiainaNum(arrow)
803
+ if (other.lte(PowiainaNum.ZERO) || !other.isint()) return PowiainaNum.NaN.clone();
804
+ if (!arrow.isint() || arrow.lt(1)) return PowiainaNum.NaN.clone();
805
+ if (other.eq(PowiainaNum.ONE)) return t.clone();
806
+ var r;
807
+ if (arrow.lt(MAX_SAFE_INTEGER)) {
808
+ if (other.gt("l0 s1 a[10000000000,[" + (arrow.toNumber().toString()) + "," + (MAX_SAFE_INTEGER - 1).toString() + ",3,1]]")) {
809
+ return other.clone();
810
+ }
811
+ else if (other.gt(PowiainaNum.MAX_SAFE_INTEGER)) {
812
+ r = PowiainaNum()
813
+
814
+ r.array = []
815
+ r.array.push(...other.array);
816
+ r.array.push([arrow.toNumber(), 1, 3, 1]);
817
+
818
+ } else {
819
+ r = PowiainaNum()
820
+
821
+ r.array = [10]
822
+ r.array.push([arrow.toNumber() - 1, other.toNumber() - 1, 3, 1]);
823
+
824
+ }
825
+ } else {
826
+ r = PowiainaNum(arrow)
827
+ r.array.push(["x", 1, 3, 1]);
828
+ }
829
+ return r.normalize();
830
+ }
800
831
 
801
832
  //#endregion
802
833
  //#endregion
@@ -1646,7 +1677,7 @@
1646
1677
  return Math.log10(Number(str.substring(0, LONG_STRING_MIN_LENGTH))) + (str.length - LONG_STRING_MIN_LENGTH);
1647
1678
  }
1648
1679
  Q.fromString = function (input, nocache=false) {
1649
- originalInput = input;
1680
+ var originalInput = input;
1650
1681
  if (typeof input != "string") throw Error(invalidArgument + "Expected String");
1651
1682
  if (C[input] && !nocache) {
1652
1683
  var x = new PowiainaNum();
package/PowiainaNum.js CHANGED
@@ -4,6 +4,8 @@
4
4
  //const ExpantaNum = require("../hyper-volume-incremental-v1/assets/scripts/technical/ExpantaNum");
5
5
 
6
6
  ; (function (globalScope) {
7
+ "use strict";
8
+
7
9
  function deepCopyProps(source, target) {
8
10
  for (let key in source) {
9
11
  if (source.hasOwnProperty(key)) {
@@ -701,37 +703,6 @@
701
703
  }
702
704
  return r.normalize();
703
705
  }
704
- Q.expansionArrow = Q.epsArrow = function (x, arrow) {
705
- other = new PowiainaNum(x)
706
- arrow = new PowiainaNum(arrow)
707
- if (other.lte(PowiainaNum.ZERO) || !other.isint()) return PowiainaNum.NaN.clone();
708
- if (!arrow.isint() || arrow.lt(1)) return PowiainaNum.NaN.clone();
709
- if (other.eq(PowiainaNum.ONE)) return t.clone();
710
- var r;
711
- if (arrow.lt(MAX_SAFE_INTEGER)) {
712
- if (other.gt("l0 s1 a[10000000000,[" + (arrow.toNumber().toString()) + "," + (MAX_SAFE_INTEGER - 1).toString() + ",1,1]]")) {
713
- return other.clone();
714
- }
715
- else if (other.gt(PowiainaNum.MAX_SAFE_INTEGER)) {
716
- r = PowiainaNum()
717
-
718
- r.array = []
719
- r.array.push(...other.array);
720
- r.array.push([arrow.toNumber(), 1, 2, 1]);
721
-
722
- } else {
723
- r = PowiainaNum()
724
-
725
- r.array = [10]
726
- r.array.push([arrow.toNumber() - 1, other.toNumber() - 1, 2, 1]);
727
-
728
- }
729
- } else {
730
- r = PowiainaNum(arrow)
731
- r.array.push(["x", 1, 2, 1]);
732
- }
733
- return r.normalize();
734
- }
735
706
  Q.multiExpansion = Q.mulEps = function (x, other) {
736
707
  return PowiainaNum(x).multiExpansion(other);
737
708
  }
@@ -764,6 +735,37 @@
764
735
  Q.powerExpansion = Q.powEps = function (x, other) {
765
736
  return PowiainaNum(x).powerExpansion(other);
766
737
  }
738
+ Q.expansionArrow = Q.epsArrow = function (x, arrow) {
739
+ var other = new PowiainaNum(x)
740
+ var arrow = new PowiainaNum(arrow)
741
+ if (other.lte(PowiainaNum.ZERO) || !other.isint()) return PowiainaNum.NaN.clone();
742
+ if (!arrow.isint() || arrow.lt(1)) return PowiainaNum.NaN.clone();
743
+ if (other.eq(PowiainaNum.ONE)) return t.clone();
744
+ var r;
745
+ if (arrow.lt(MAX_SAFE_INTEGER)) {
746
+ if (other.gt("l0 s1 a[10000000000,[" + (arrow.toNumber().toString()) + "," + (MAX_SAFE_INTEGER - 1).toString() + ",2,1]]")) {
747
+ return other.clone();
748
+ }
749
+ else if (other.gt(PowiainaNum.MAX_SAFE_INTEGER)) {
750
+ r = PowiainaNum()
751
+
752
+ r.array = []
753
+ r.array.push(...other.array);
754
+ r.array.push([arrow.toNumber(), 1, 2, 1]);
755
+
756
+ } else {
757
+ r = PowiainaNum()
758
+
759
+ r.array = [10]
760
+ r.array.push([arrow.toNumber() - 1, other.toNumber() - 1, 2, 1]);
761
+
762
+ }
763
+ } else {
764
+ r = PowiainaNum(arrow)
765
+ r.array.push(["x", 1, 2, 1]);
766
+ }
767
+ return r.normalize();
768
+ }
767
769
 
768
770
  //#endregion
769
771
 
@@ -798,6 +800,37 @@
798
800
  Q.explosion = P.els = function (x, other) {
799
801
  return PowiainaNum(x).explosion(other);
800
802
  }
803
+ Q.explosionArrow = Q.elsArrow = function (x, arrow) {
804
+ var other = new PowiainaNum(x)
805
+ var arrow = new PowiainaNum(arrow)
806
+ if (other.lte(PowiainaNum.ZERO) || !other.isint()) return PowiainaNum.NaN.clone();
807
+ if (!arrow.isint() || arrow.lt(1)) return PowiainaNum.NaN.clone();
808
+ if (other.eq(PowiainaNum.ONE)) return t.clone();
809
+ var r;
810
+ if (arrow.lt(MAX_SAFE_INTEGER)) {
811
+ if (other.gt("l0 s1 a[10000000000,[" + (arrow.toNumber().toString()) + "," + (MAX_SAFE_INTEGER - 1).toString() + ",3,1]]")) {
812
+ return other.clone();
813
+ }
814
+ else if (other.gt(PowiainaNum.MAX_SAFE_INTEGER)) {
815
+ r = PowiainaNum()
816
+
817
+ r.array = []
818
+ r.array.push(...other.array);
819
+ r.array.push([arrow.toNumber(), 1, 3, 1]);
820
+
821
+ } else {
822
+ r = PowiainaNum()
823
+
824
+ r.array = [10]
825
+ r.array.push([arrow.toNumber() - 1, other.toNumber() - 1, 3, 1]);
826
+
827
+ }
828
+ } else {
829
+ r = PowiainaNum(arrow)
830
+ r.array.push(["x", 1, 3, 1]);
831
+ }
832
+ return r.normalize();
833
+ }
801
834
 
802
835
  //#endregion
803
836
  //#endregion
@@ -1647,7 +1680,7 @@
1647
1680
  return Math.log10(Number(str.substring(0, LONG_STRING_MIN_LENGTH))) + (str.length - LONG_STRING_MIN_LENGTH);
1648
1681
  }
1649
1682
  Q.fromString = function (input, nocache=false) {
1650
- originalInput = input;
1683
+ var originalInput = input;
1651
1684
  if (typeof input != "string") throw Error(invalidArgument + "Expected String");
1652
1685
  if (C[input] && !nocache) {
1653
1686
  var x = new PowiainaNum();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "powiaina_num.js",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "A JavaScript library that handles arithmetic for numbers as large as {10,9e15,1,1,1,2}.",
5
5
  "main": "PowiainaNum.js",
6
6
  "module": "PowiainaNum.esm.js",