|
@@ -40,9 +40,9 @@ export function createSinFun () {
|
|
|
} else {
|
|
|
result = Decimal.sin(convertToRadians(angle));
|
|
|
}
|
|
|
- if(result.dp() > Config.decimalPlaces) {
|
|
|
- result = new Decimal(result.toFixed(Config.decimalPlaces));
|
|
|
- }
|
|
|
+ // if(result.dp() > Config.decimalPlaces) {
|
|
|
+ // result = new Decimal(result.toFixed(Config.decimalPlaces));
|
|
|
+ // }
|
|
|
const temp = new StoreObject(Types.REAL, result);
|
|
|
sto.mode = Modes.RETURN;
|
|
|
return Promise.resolve(sto.updateStore('$', temp));
|
|
@@ -68,9 +68,9 @@ export function createCosFun () {
|
|
|
result = new Decimal(0)
|
|
|
}
|
|
|
result = Decimal.cos(convertToRadians(angle));
|
|
|
- if(result.dp() > Config.decimalPlaces) {
|
|
|
- result = new Decimal(result.toFixed(Config.decimalPlaces));
|
|
|
- }
|
|
|
+ // if(result.dp() > Config.decimalPlaces) {
|
|
|
+ // result = new Decimal(result.toFixed(Config.decimalPlaces));
|
|
|
+ // }
|
|
|
const temp = new StoreObject(Types.REAL, result);
|
|
|
sto.mode = Modes.RETURN;
|
|
|
return Promise.resolve(sto.updateStore('$', temp));
|
|
@@ -91,9 +91,9 @@ export function createTanFun () {
|
|
|
return Promise.reject("Tangent of "+x.value.toNumber()+"° is undefined.");
|
|
|
}
|
|
|
let result = Decimal.tan(convertToRadians(angle));
|
|
|
- if(result.dp() > Config.decimalPlaces) {
|
|
|
- result = new Decimal(result.toFixed(Config.decimalPlaces));
|
|
|
- }
|
|
|
+ // if(result.dp() > Config.decimalPlaces) {
|
|
|
+ // result = new Decimal(result.toFixed(Config.decimalPlaces));
|
|
|
+ // }
|
|
|
const temp = new StoreObject(Types.REAL, result);
|
|
|
sto.mode = Modes.RETURN;
|
|
|
return Promise.resolve(sto.updateStore('$', temp));
|
|
@@ -110,9 +110,9 @@ export function createSqrtFun () {
|
|
|
const sqrtFun = (sto, _) => {
|
|
|
const x = sto.applyStore('x');
|
|
|
let result = x.value.sqrt();
|
|
|
- if(result.dp() > Config.decimalPlaces) {
|
|
|
- result = new Decimal(result.toFixed(Config.decimalPlaces));
|
|
|
- }
|
|
|
+ // if(result.dp() > Config.decimalPlaces) {
|
|
|
+ // result = new Decimal(result.toFixed(Config.decimalPlaces));
|
|
|
+ // }
|
|
|
const temp = new StoreObject(Types.REAL, result);
|
|
|
sto.mode = Modes.RETURN;
|
|
|
return Promise.resolve(sto.updateStore('$', temp));
|
|
@@ -130,9 +130,9 @@ export function createPowFun () {
|
|
|
const x = sto.applyStore('x');
|
|
|
const y = sto.applyStore('y');
|
|
|
let result = x.value.pow(y.value);
|
|
|
- if(result.dp() > Config.decimalPlaces) {
|
|
|
- result = new Decimal(result.toFixed(Config.decimalPlaces));
|
|
|
- }
|
|
|
+ // if(result.dp() > Config.decimalPlaces) {
|
|
|
+ // result = new Decimal(result.toFixed(Config.decimalPlaces));
|
|
|
+ // }
|
|
|
const temp = new StoreObject(Types.REAL, result);
|
|
|
sto.mode = Modes.RETURN;
|
|
|
return Promise.resolve(sto.updateStore('$', temp));
|
|
@@ -153,9 +153,9 @@ export function createLogFun () {
|
|
|
return Promise.reject(new Error("the value passed to log function cannot be negative"));
|
|
|
}
|
|
|
let result = Decimal.log10(x.value);
|
|
|
- if(result.dp() > Config.decimalPlaces) {
|
|
|
- result = new Decimal(result.toFixed(Config.decimalPlaces));
|
|
|
- }
|
|
|
+ // if(result.dp() > Config.decimalPlaces) {
|
|
|
+ // result = new Decimal(result.toFixed(Config.decimalPlaces));
|
|
|
+ // }
|
|
|
const temp = new StoreObject(Types.REAL, result);
|
|
|
sto.mode = Modes.RETURN;
|
|
|
return Promise.resolve(sto.updateStore('$', temp));
|
|
@@ -205,9 +205,9 @@ export function createInvertFun () {
|
|
|
const invertFun = (sto, _) => {
|
|
|
const x = sto.applyStore('x');
|
|
|
let result = toReal(1).dividedBy(x.value);
|
|
|
- if(result.dp() > Config.decimalPlaces) {
|
|
|
- result = new Decimal(result.toFixed(Config.decimalPlaces));
|
|
|
- }
|
|
|
+ // if(result.dp() > Config.decimalPlaces) {
|
|
|
+ // result = new Decimal(result.toFixed(Config.decimalPlaces));
|
|
|
+ // }
|
|
|
const temp = new StoreObject(Types.REAL, result);
|
|
|
sto.mode = Modes.RETURN;
|
|
|
return Promise.resolve(sto.updateStore('$', temp));
|