-
-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Snippets] Added several new mathematical snippets for JavaScript. #179
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me it looks good, but i'm not a math guy myself, so let's wait on another review and I think we will be good
@Mathys-Gasnier You can ask ChatGPT if none of the other reviewers know this math. Wouldn't expect anyone to understand it anyways. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, almost all of these functions are available in the mathjs
library, So, maybe include how to perform the same calculation using that library as well. I like these snippets, but anyone who wants to do a lot of complex calculations like erf
might be better of using the library. @Mathys-Gasnier.
IMO we shouldn't take into account external dependencies when deciding if snippets should be added, the reason being that some people don't like adding lots of deps to their project (which is a good thing seeing how NPM packages keep failing in the last couple of years) |
I agree with Mathys, since I personally don't like bloating up my projects with random packages. Aside from that, I also intended for people to be able to just copy and paste them into a website that is made only with HTML, CSS and bare bones JS, no node.js and npm stuff. That said, if a separate "Node.js" language category is added, I may add snippets on how to use mathjs for those. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good. I too now agree on the package bloating 🫡 .
Finally, thank you for your contribution to the project @JanluOfficial.
You're welcome @psychlone77 |
Description
Added a bunch of snippets regarding math functions in JavaScript. These include the following:
I also updated the tags for greatest common divisor, which I added as a snippet in [Snippet] Added code snippet for Greatest Common Divisor in JS #170 .
Type of Change
Checklist
Related Issues
None
Additional Context
I let ChatGPT help me with explaining and occasionally writing the JavaScript required for these snippets, but I double checked that everything works using node.js, as well as on a about:blank page in the DevTools of Microsoft Edge.
Screenshots (Optional)
Click to view screenshots