Skip to content

Commit

Permalink
0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Naruyoko committed Dec 1, 2019
1 parent 94f5725 commit d08f8c1
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@

npm-debug.log
npm-debug.log
test.html
25 changes: 18 additions & 7 deletions OmegaNum.js
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@
}
var y=other.toNumber();
var f=Math.floor(y);
r=OmegaNum.pow(10,y-f);
r=t.pow(y-f);
for (var i=0;f!==0&&r.lt("e"+MAX_SAFE_INTEGER)&&i<100;++i){
if (f>0){
r=t.pow(r);
Expand Down Expand Up @@ -769,6 +769,7 @@
Q.pentate=Q.pent=function (x,y){
return OmegaNum.arrow(x,3,y);
};
//Uses linear approximations for real height
P.arrow=function (arrows){
var t=this.clone();
arrows=new OmegaNum(arrows);
Expand All @@ -779,7 +780,7 @@
return function (other){
other=new OmegaNum(other);
if (OmegaNum.debug>=OmegaNum.NORMAL) console.log(t+"{"+arrows+"}"+other);
if (!other.isint()||other.lt(0)) return new OmegaNum(NaN);
if (other.lt(0)) return new OmegaNum(NaN);
if (other.eq(0)) return new OmegaNum(1);
if (other.eq(1)) return t.clone();
if (arrows.gte(OmegaNum.maxArrow)){
Expand All @@ -802,8 +803,17 @@
other.standardize();
return other;
}
r=t.arrow(arrows-1)(t.arrow(arrows-1)(t));
r.array[arrows-1]=(r.array[arrows-1]+other.sub(3).toNumber())||other.sub(3).toNumber();
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){
if (f>0){
r=t.arrow(arrows.sub(1))(r);
--f;
}
}
if (i==100) f=0;
r.array[arrows.sub(1)]=(r.array[arrows.sub(1)]+f)||f;
r.standardize();
return r;
};
Expand Down Expand Up @@ -901,6 +911,10 @@
}
for (var i=0;i<x.array.length;i++){
var e=x.array[i];
if (e===null||e===undefined){
x.array[i]=0;
continue;
}
if (isNaN(e)){
x.array=[NaN];
return x;
Expand All @@ -909,9 +923,6 @@
x.array=[Infinity];
return x;
}
if (e===null||e===undefined){
x.array[i]=0;
}
}
do{
if (OmegaNum.debug>=OmegaNum.ALL) console.log(x.toString());
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) ![1](https://raw.githubusercontent.com/Naruyoko/OmegaNum.js/non-code/1.png) ![.](https://raw.githubusercontent.com/Naruyoko/OmegaNum.js/non-code/dot.png) ![1](https://raw.githubusercontent.com/Naruyoko/OmegaNum.js/non-code/1.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) ![0](https://raw.githubusercontent.com/Naruyoko/OmegaNum.js/non-code/0.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
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.2.0 - 2019/12/01
* Expanded all hyperoperators to real height.
* Fixed `pent` and above sometimes returning `NaN`.

# 0.1.1 - 2019/11/28
* Many optimizations. See diff for what I did.

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.1.1",
"version": "0.2.0",
"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 d08f8c1

Please sign in to comment.