Skip to content

Commit

Permalink
0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Naruyoko committed Mar 27, 2020
1 parent 8db6126 commit 3c17977
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 7 deletions.
50 changes: 47 additions & 3 deletions OmegaNum.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@
* isNaN
* isNegative isneg
* isPositive ispos
* iteratedexp
* iteratedlog
* lambertw
* layeradd
* layeradd10
* lessThan lt
* lessThanOrEqualTo lte
* logarithm logBase
Expand Down Expand Up @@ -655,9 +659,12 @@
};
//end break_eternity.js excerpt
//Uses linear approximations for real height
P.tetrate=P.tetr=function (other){
P.tetrate=P.tetr=function (other,payload){
if (payload===undefined) payload=OmegaNum.ONE;
var t=this.clone();
other=new OmegaNum(other);
payload=new OmegaNum(payload);
if (payload.neq(OmegaNum.ONE)) other=other.add(payload.slog(t));
if (OmegaNum.debug>=OmegaNum.NORMAL) console.log(t+"^^"+other);
var negln;
if (other.isInfinite()&&other.sign>0){
Expand Down Expand Up @@ -724,9 +731,46 @@
r.standardize();
return r;
};
Q.tetrate=Q.tetr=function (x,y){
return new OmegaNum(x).tetr(y);
Q.tetrate=Q.tetr=function (x,y,payload){
return new OmegaNum(x).tetr(y,payload);
};
//Implementation of functions from break_eternity.js
P.iteratedexp=function (other,payload){
return this.tetr(other,payload);
};
Q.iteratedexp=function (x,y,payload){
return new OmegaNum(x).iteratedexp(other,payload);
}
//This implementation is highly inaccurate and slow, and probably be given custom code
P.iteratedlog=function (base,other){
if (base===undefined) base=10;
if (other===undefined) other=OmegaNum.ONE.clone();
var t=this.clone();
base=new OmegaNum(base);
other=new OmegaNum(other);
return base.tetr(t.slog(base).sub(other));
}
Q.iteratedlog=function (x,y,z){
return new OmegaNum(x).iteratedlog(y,z);
}
P.layeradd=function (other,base){
if (base===undefined) base=10;
if (other===undefined) other=OmegaNum.ONE.clone();
var t=this.clone();
base=new OmegaNum(base);
other=new OmegaNum(other);
return base.tetr(t.slog(base).add(other));
}
Q.layeradd=function (x,y,z){
return new OmegaNum(x).layeradd(y,z);
}
P.layeradd10=function (other){
return this.layeradd(other);
}
Q.layeradd10=function (x,y){
return new OmegaNum(x).layeradd10(y);
}
//End implementation from break_eternity.js
//All of these are from Patashu's break_eternity.js
//The super square-root function - what number, tetrated to height 2, equals this?
//Other sroots are possible to calculate probably through guess and check methods, this one is easy though.
Expand Down
2 changes: 1 addition & 1 deletion OmegaNum.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions 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) ![4](https://raw.githubusercontent.com/Naruyoko/OmegaNum.js/non-code/4.png) ![.](https://raw.githubusercontent.com/Naruyoko/OmegaNum.js/non-code/dot.png) ![3](https://raw.githubusercontent.com/Naruyoko/OmegaNum.js/non-code/3.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) ![5](https://raw.githubusercontent.com/Naruyoko/OmegaNum.js/non-code/5.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.

Expand All @@ -8,7 +8,7 @@ Internally, it is represented as an sign and array. Sign is 1 or -1. Array is \[

For detailed explanation and documentation, [see here](https://naruyoko.github.io/OmegaNum.js/index.html).

Functions are as follows: `abs, neg, cmp, gt, gte, lt, lte, eq, neq, min, max, ispos, isneg, isNaN, isFinite, isint, floor, ceiling, round, add, sub, mul, div, rec, mod, gamma, fact, pow, exp, sqrt, cbrt, root, log10, logBase, log(alias ln), lambertw, tetr, ssrt, slog, pent, arrow, chain, hyper, affordGeometricSeries, affordArithmeticSeries, sumGeometricSeries, sumArithmeticSeries, choose`. Of course, there are `toNumber()`, `toString()` (`toValue`, `toStringWithDecimalPlaces`, `toExponential`, `toFixed`, `toPrecision`), and `toJSON()`. Add one of a kind `toHyperE()`.
Functions are as follows: `abs, neg, cmp, gt, gte, lt, lte, eq, neq, min, max, ispos, isneg, isNaN, isFinite, isint, floor, ceiling, round, add, sub, mul, div, rec, mod, gamma, fact, pow, exp, sqrt, cbrt, root, log10, logBase, log(alias ln), lambertw, tetr, iteratedexp, iteratedlog, layeradd, layeradd10, ssrt, slog, pent, arrow, chain, hyper, affordGeometricSeries, affordArithmeticSeries, sumGeometricSeries, sumArithmeticSeries, choose`. Of course, there are `toNumber()`, `toString()` (`toValue`, `toStringWithDecimalPlaces`, `toExponential`, `toFixed`, `toPrecision`), and `toJSON()`. Add one of a kind `toHyperE()`.

If you are using built-in constants: Constants can not be replaced directly, however **the properties of it can. As the constants are also used inside OmegaNum.js, modifying them could CAUSE SERIOUS ISSUES AND POTENTIALLY RENDER THE LIBRARY UNUSABLE.**

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.5.0 - 2020/03/27
* Added `iteratedexp`, `iteratedlog`, `layeradd`, and `layeradd10`.
* Added voluntary `payload` argument to `tetr`.

# 0.4.3 - 2020/03/25
* Fixed `ExpantaNum.MAX_SAFE_INTEGER.log10()` being irregular form.

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.4.3",
"version": "0.5.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 3c17977

Please sign in to comment.