Skip to content

Commit

Permalink
0.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Naruyoko committed Dec 19, 2019
1 parent 73e7478 commit f4e7be2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
16 changes: 8 additions & 8 deletions OmegaNum.js
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@
//from https://math.stackexchange.com/a/465183
//The evaluation can become inaccurate very close to the branch point
var f_lambertw=function (z,tol){
if (tol==undefined) tol=1e-10;
if (tol===undefined) tol=1e-10;
var w;
var wn;
if (!Number.isFinite(z)) return z;
Expand Down Expand Up @@ -675,7 +675,7 @@
var y=other.toNumber();
var f=Math.floor(y);
var r=t.pow(y-f);
for (var i=0;f!==0&&r.lt("e"+MAX_SAFE_INTEGER)&&i<100;++i){
for (var i=0,m=new OmegaNum("e"+MAX_SAFE_INTEGER);f!==0&&r.lt(m)&&i<100;++i){
if (f>0){
r=t.pow(r);
--f;
Expand Down Expand Up @@ -793,7 +793,6 @@
if (t.max(other).gt("10{"+arrows.add(1)+"}"+MAX_SAFE_INTEGER)) return t.max(other);
var r;
if (other.gt(MAX_SAFE_INTEGER)){
debugger;
if (t.gt("10{"+arrows+"}"+MAX_SAFE_INTEGER)){
r=t.clone();
r.array[arrows]--;
Expand All @@ -811,7 +810,7 @@
var y=other.toNumber();
var f=Math.floor(y);
r=t.arrow(arrows.sub(1))(y-f);
for (var i=0;f!==0&&r.lt("10{"+arrows.sub(1)+"}"+MAX_SAFE_INTEGER)&&i<100;++i){
for (var i=0,m=new OmegaNum("10{"+arrows.sub(1)+"}"+MAX_SAFE_INTEGER);f!==0&&r.lt(m)&&i<100;++i){
if (f>0){
r=t.arrow(arrows.sub(1))(r);
--f;
Expand Down Expand Up @@ -914,7 +913,7 @@
if (typeof x.sign!="number") x.sign=Number(x.sign);
x.sign=x.sign<0?-1:1;
}
for (var i=0;i<x.array.length;i++){
for (var l=x.array.length,i=0;i<l;i++){
var e=x.array[i];
if (e===null||e===undefined){
x.array[i]=0;
Expand All @@ -924,7 +923,7 @@
x.array=[NaN];
return x;
}
if (e==Infinity){
if (!isFinite(e)){
x.array=[Infinity];
return x;
}
Expand All @@ -946,14 +945,14 @@
x.array[1]--;
b=true;
}
if (!x.array[1]&&x.array.length>2){
if (x.array.length>2&&!x.array[1]){
for (i=2;!x.array[i];++i) continue;
x.array[i-1]=x.array[0];
x.array[0]=1;
x.array[i]--;
b=true;
}
for (i=1;i<x.array.length;++i){
for (l=x.array.length,i=1;i<l;++i){
if (x.array[i]>MAX_SAFE_INTEGER){
x.array[i+1]=(x.array[i+1]||0)+1;
x.array[0]=x.array[i]+1;
Expand Down Expand Up @@ -1166,6 +1165,7 @@
};
Q.fromObject=function (input){
if (typeof input!="object") throw Error(invalidArgument+"Expected Object");
if (input===null) return new OmegaNum(0);
if (input instanceof Array) return OmegaNum.fromArray(input);
if (input instanceof OmegaNum) return new OmegaNum(input);
if (!(input.array instanceof Array)) throw Error(invalidArgument+"Expected that property 'array' exists");
Expand Down
2 changes: 1 addition & 1 deletion OmegaNum.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ![OmegaNum.js](https://raw.githubusercontent.com/Naruyoko/OmegaNum.js/non-code/OmegaNumJS.png) ![0](https://raw.githubusercontent.com/Naruyoko/OmegaNum.js/non-code/0.png) ![.](https://raw.githubusercontent.com/Naruyoko/OmegaNum.js/non-code/dot.png) ![2](https://raw.githubusercontent.com/Naruyoko/OmegaNum.js/non-code/2.png) ![.](https://raw.githubusercontent.com/Naruyoko/OmegaNum.js/non-code/dot.png) ![2](https://raw.githubusercontent.com/Naruyoko/OmegaNum.js/non-code/2.png)
# ![OmegaNum.js](https://raw.githubusercontent.com/Naruyoko/OmegaNum.js/non-code/OmegaNumJS.png) ![0](https://raw.githubusercontent.com/Naruyoko/OmegaNum.js/non-code/0.png) ![.](https://raw.githubusercontent.com/Naruyoko/OmegaNum.js/non-code/dot.png) ![2](https://raw.githubusercontent.com/Naruyoko/OmegaNum.js/non-code/2.png) ![.](https://raw.githubusercontent.com/Naruyoko/OmegaNum.js/non-code/dot.png) ![3](https://raw.githubusercontent.com/Naruyoko/OmegaNum.js/non-code/3.png)
[![NPM](https://img.shields.io/npm/v/omega_num.js.svg)](https://www.npmjs.com/package/omega_num.js)
A huge number library holding up to 10{1000}9e15. A basement for planned {10,x,1,2}.

Expand Down
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 0.2.3 - 2019/12/18
* Slight optimizations for higher hyperoperators.

# 0.2.2 - 2019/12/07 HOTFIX
* Fixed line 677.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "omega_num.js",
"version": "0.2.2",
"version": "0.2.3",
"description": "A JavaScript library that handles arithmetic for numbers as large as 10{1000}9e15.",
"main": "OmegaNum.js",
"scripts": {
Expand Down

0 comments on commit f4e7be2

Please sign in to comment.