4 ms·
Picomath: self-contained math functions in 11 languages
- Tanner 15y agoGreat! I had been passively looking for a lua gamma function to replace one I had been using since lmathx can't be compiled on Windows. Passively found!
- Deutscher 15y agoI didn't check them all, but I got 403 and blank pages when trying to access the python and C++ files respectively.
- zwieback 15y agome too, IE and Chrome
- p4bl0 15y agoAlso 403 for Python. The other page are blank because they use <script ... /> which is not correct and should be <script ...></script> but the code is here if you look at the source.
- wccrawford 15y agoEven odder, the text is actually there, if you view the source. I think maybe his pretty print javascript is going haywire.
- deleted 15y ago[deleted]
- pygy_ 15y agoYou can find the code on the GitHub page: https://github.com/ghewgill/picomath https://github.com/ghewgill/picomath
- GrangalanJr 15y agoI noticed that the Ruby pages link to files that end in ".rb.html", but if you remove the ".html" from the end, it leads you right to the Ruby files.
- deleted 15y ago[deleted]
- SlyShy 15y agoPretty cool. The Ruby port is of questionable use, considering erf, gamma, etc. are already implemented in the Math module.
- ghewgill 15y agoNewer versions of Python also contain implementations for gamma and erf. I implemented all functions in each language mostly for completeness, but I will add a note in the code snippet where the function is already provided by the language standard library.
- johndcook 15y agoThe site has been updated to fix the problem with the source being invisible.
- kungfu71186 15y agoI was just wondering, what would you use the gamma function for? I'm not that far enough in the mathematical field to know, so that's why i ask. Maybe a real world example? Thanks.
- ggchappell 15y agoThe gamma function shows up in a number of common probability distributions. For example, there is the gamma distribution, which is useful for modeling how long it will be until some random-ish thing happens: how long until some machine fails, how long until some extreme weather event happens. (Or something like that; I'm at the far borders of my field of expertise here.)
- andrewcooke 15y agothanks for this. but why not make the c++ examples c? then both c and c++ users can use them (and other languages wrap them more easily). looking at a few examples, it shouldn't be too much work.
- brianobush 15y agoNo C? Seems like one would have done these in C instead of C++. Not that there is much to change, but it would suite a wider audience.
- tzs 15y agoCool. It could be useful to add the incomplete gamma functions. They are used in calculating the chi squared distribution, and so come up in analyzing A/B testing.