Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Thanks for posting that. You had a transcribing typo which was corrected in the ECMAScript below. Here's the calculation for 5 x 7:

    const eml = (x,y) => Math.exp(x) - Math.log(y);
    const mul = (x,y) => eml(eml(1,eml(eml(eml(1,eml(eml(1,eml(1,x)),1)),eml(1,eml(eml(1,eml(y,1)),1))),1)),1);
    console.log(mul(5,7));
> 35.00000000000001

For larger or negative inputs you get a NaN because ECMAScript has limited precision and doesn't handle imaginary numbers.



> For larger or negative inputs you get a NaN because ECMAScript has limited precision and doesn't handle imaginary numbers.

This also shows why EML is not practical for computation.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: