From 807572b9c41e43cb2d0c7886b4e4eab0e3b95f20 Mon Sep 17 00:00:00 2001 From: tevador <37503146+tevador@users.noreply.github.com> Date: Wed, 20 Jun 2018 17:39:43 +0200 Subject: [PATCH] Removed math functions from generator.md --- doc/generator.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/doc/generator.md b/doc/generator.md index 571fd8b..6ab4746 100644 --- a/doc/generator.md +++ b/doc/generator.md @@ -192,7 +192,9 @@ function __prec(_) { return +_.toPrecision(__fpMathPrec); } ``` -This function is used whenever a mathematical operation with inexact result is performed (for example `Math.exp` or other trancendental math functions). The function rounds off the number to a specific number of decimal significant digits given by the `__fpMathPrec` constant. The value of this constant is generated at random from interval 10-14. It has been determined empirically that the first 14 significant digits match across different platforms (see [Issue 3](https://github.com/tevador/RandomJS/issues/3)). +~~This function is used whenever a mathematical operation with inexact result is performed (for example `Math.exp` or other trancendental math functions). The function rounds off the number to a specific number of decimal significant digits given by the `__fpMathPrec` constant. The value of this constant is generated at random from interval 10-14. It has been determined empirically that the first 14 significant digits match across different platforms (see [Issue 3](https://github.com/tevador/RandomJS/issues/3)).~~ + +This function is currently unused. #### NNEG function ```javascript @@ -355,25 +357,25 @@ Additionally, the following mathematical function calls can be generated as a `U |Operator|Function|Attributes| |--------|------|----------| -|Sqrt|`Math.sqrt`|NumericOnly, LimitedPrecision, NonnegativeRHS| +|Sqrt|`Math.sqrt`|NumericOnly, NonnegativeRHS| |Abs|`Math.abs`|NumericOnly| |Ceil|`Math.ceil`|NumericOnly| |Trunc|`Math.trunc`|NumericOnly| |Floor|`Math.floor`|NumericOnly| -|Sin|`Math.sin`|NumericOnly, LimitedPrecision| -|Cos|`Math.cos`|NumericOnly, LimitedPrecision| -|Exp|`Math.exp`|NumericOnly, LimitedPrecision| -|Log|`Math.log`|NumericOnly, LimitedPrecision, NonnegativeRHS| -|Atan|`Math.atan`|NumericOnly, LimitedPrecision| +|~~Sin~~|~~`Math.sin`~~|~~NumericOnly, LimitedPrecision~~| +|~~Cos~~|~~`Math.cos`~~|~~NumericOnly, LimitedPrecision~~| +|~~Exp~~|~~`Math.exp`~~|~~NumericOnly, LimitedPrecision~~| +|~~Log~~|~~`Math.log`~~|~~NumericOnly, LimitedPrecision, NonnegativeRHS~~| +|~~Atan~~|~~`Math.atan`~~|~~NumericOnly, LimitedPrecision~~| Explanation of operator attributes: * **NumericOnly** - the right-hand side expression (argument) must be wrapped in a call to the NUMB helper function to ensure numeric input * **NonnegativeRHS** - the right-hand side must be wrapped in a call to the NNEG helper function -* **LimitedPrecision** - the result of the operation must be wrapped in the PREC helper function to ensure consistency across platforms +* ~~**LimitedPrecision** - the result of the operation must be wrapped in the PREC helper function to ensure consistency across platforms~~ Examples: -* `__prec(Math.log(__nneg(__numb((a=(-10)), 81711.92057))))` +* `__prec(Math.sqrt(__nneg(__numb((a=(-10)), 81711.92057))))` * `(typeof __invk(d,{a:(-200362066),b:"r75",}))` * `Math.floor(__numb(b, 76952.72820))`