News for hackers. Stuff that matters.
Re:Picomath: self-contained math functions in 11 languages by Deutscher on Wednesday July 13, 2011 @12:22PM (#2759441)
I didn't check them all, but I got 403 and blank pages when trying to access the python and C++ files respectively.
Re:Picomath: self-contained math functions in 11 languages by pygy_ on Wednesday July 13, 2011 @12:48PM (#2759577)
You can find the code on the GitHub page: https://github.com/ghewgill/picomath
Re:Picomath: self-contained math functions in 11 languages by p4bl0 on Wednesday July 13, 2011 @12:43PM (#2759555)
Also 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.
Re:Picomath: self-contained math functions in 11 languages by ghewgill on Wednesday July 13, 2011 @03:13PM (#2760195)
Thanks for noticing that! I've fixed the code and it should work now. (It was probably only a problem for IE, please let me know if it's still not fixed.)
Re:Picomath: self-contained math functions in 11 languages by p4bl0 on Wednesday July 13, 2011 @03:18PM (#2760215)
It seems fixed but it was not a IE only problem, I'm using Firefox v5.
Re:Picomath: self-contained math functions in 11 languages by wccrawford on Wednesday July 13, 2011 @12:44PM (#2759561)
Even odder, the text is actually there, if you view the source. I think maybe his pretty print javascript is going haywire.
Re:Picomath: self-contained math functions in 11 languages by GrangalanJr on Wednesday July 13, 2011 @01:10PM (#2759640)
I 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.
Re:Picomath: self-contained math functions in 11 languages by zwieback on Wednesday July 13, 2011 @12:24PM (#2759449)
me too, IE and Chrome
Re:Picomath: self-contained math functions in 11 languages by SlyShy on Wednesday July 13, 2011 @01:28PM (#2759721)
Pretty cool. The Ruby port is of questionable use, considering erf, gamma, etc. are already implemented in the Math module.
Re:Picomath: self-contained math functions in 11 languages by ghewgill on Wednesday July 13, 2011 @03:16PM (#2760206)
Newer 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.
Re:Picomath: self-contained math functions in 11 languages by kungfu71186 on Wednesday July 13, 2011 @03:54PM (#2760375)
I 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.
Re:Picomath: self-contained math functions in 11 languages by ggchappell on Wednesday July 13, 2011 @04:52PM (#2760628)
The 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.)
Re:Picomath: self-contained math functions in 11 languages by andrewcooke on Wednesday July 13, 2011 @04:11PM (#2760462)
thanks 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.
Re:Picomath: self-contained math functions in 11 languages by brianobush on Wednesday July 13, 2011 @05:12PM (#2760706)
No 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.
Re:Picomath: self-contained math functions in 11 languages by tzs on Wednesday July 13, 2011 @11:19PM (#2761620)
Cool. 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.
Re:Picomath: self-contained math functions in 11 languages by Tanner on Wednesday July 13, 2011 @02:42PM (#2760081)
Great! 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!
Re:Picomath: self-contained math functions in 11 languages by johndcook on Wednesday July 13, 2011 @03:16PM (#2760205)
The site has been updated to fix the problem with the source being invisible.