"Numbers to expressions" incorrect for small numbers
See original GitHub issueA little confused that my obfuscated code worked differently than the original code, then I found that it’s the “numbers to expressions” misbehaving.
Current Behavior
“Numbers to expressions” option loses accuracy for small numbers, turning them into 0.
Steps to Reproduce
const epsilon = 1e-13; if(0 < epsilon) alert("math works!");
- Obfuscate with “numbers to expressions” option on
- Math doesn’t work 😦
It’ll be great if this feature can be made more robust. I haven’t looked at the implementation code, but I guess you can do something like the following:
- For any number x, extract its integer and decimal part
- Obfuscate the integer part as what you would do
- Generate a random integer n between 100 and 100000, and obfuscate the decimal part d as [result of d * n] / n (maybe even obfuscate n as what you would do)
- add 'em up
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (8 by maintainers)
Top Results From Across the Web
Replace very small numbers by zero in the expression [closed]
When I calculate derivative of expression which is function of x,y really small number appear in my answer. Is there any way to...
Read more >Translating Word Problems: Examples - Purplemath
Demonstrates how to translate word problems from English sentences into mathematical equations.
Read more >Numerical Forms & Examples | What is a Numerical Expression?
A numerical expression is a combination of numbers and mathematical operations such as addition, subtraction, multiplication or division. Be ...
Read more >Rules of Exponents
Simplify and solve expressions in exponential notation. ... The other part of the notation is a small number written in superscript to the...
Read more >Number Expressions | Engineering Writing Center
Here are some of the most common issues writers have with number expressions in technical documents.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No, i haven’t fixed anything yet. Right now i’m thinking about the solution but looks like the easiest way is to convert only integer numbers
То чувство когда случайно включил гуглпереводчик. Но он сделал все только прекраснее.