Thanks Charlie, that's really helpful!<div><br></div><div>Yeah ceil is easy. Pow can be done if log() and exp() are available, and exp() shouldn't be too hard I think.</div><div><div>def pow(x,y):</div><div> return exp(y*log(x))</div>
<div><br></div>Blaine<br>
<br><br><div class="gmail_quote">On Wed, Nov 16, 2011 at 1:03 PM, Charlie Hui <span dir="ltr"><<a href="mailto:cjhui@yahoo.com">cjhui@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div style="color:#000;background-color:#fff;font-family:arial, helvetica, sans-serif;font-size:10pt"><div><span><font size="2"><a href="http://en.literateprograms.org/Logarithm_Function_(Python)" target="_blank">http://en.literateprograms.org/Logarithm_Function_(Python)</a></font><br>
</span></div><div><font size="2">ceil seems pretty easy to implement...</font></div><div><font size="2">pow? Integer only?</font></div><div><font size="2"><br></font></div><div><font size="2">--C</font></div><div style="font-family:arial, helvetica, sans-serif;font-size:10pt">
<br></div><div style="font-size:10pt;font-family:arial, helvetica, sans-serif"><div style="font-size:12pt;font-family:'times new roman', 'new york', times, serif"><font size="2" face="Arial"><hr size="1">
<b><span style="font-weight:bold">From:</span></b> Blaine <<a href="mailto:frikker@gmail.com" target="_blank">frikker@gmail.com</a>><br>
<b><span style="font-weight:bold">To:</span></b> <a href="mailto:pypy-dev@python.org" target="_blank">pypy-dev@python.org</a><br><b><span style="font-weight:bold">Sent:</span></b> Wednesday, November 16, 2011 9:21 AM<br>
<b><span style="font-weight:bold">Subject:</span></b> [pypy-dev] Pure Python Math Library<br>
</font><div><div></div><div class="h5"><br>
<div>Does anyone know of a pure python math library? I've been playing around with <a rel="nofollow" href="https://github.com/bjpop/berp/wiki" target="_blank">berp</a>, which is a python3 to haskell translator and compiler, and it works great as long as you don't go crazy with C extensions. It's highly experimental but fun to play around with. The only thing that I really miss is being able to use the math module. I asked the maintainer if it is possible to map into haskell's math library, but in the mean time a pure python math library would fit nicely since it would be compiled along with the rest of the python.<div>
<br></div><div>I'm looking for log, log10, ceil, and pow mostly for my personal needs.</div><div><br></div><div>It's funny now that things like pypy and berp exist. I find myself trying to locate pure python routines (like DFT) that would have no reason to exist with cpython, but make lots of sense with pypy.</div>
<div><br></div><div>Anyway, just wondering if anyone had heard of such a thing. How do you even implement log?</div><div><br></div><div>Thanks,</div><div>Blaine<br>
</div>
</div><br></div></div><div class="im">_______________________________________________<br>pypy-dev mailing list<br><a href="mailto:pypy-dev@python.org" target="_blank">pypy-dev@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/pypy-dev" target="_blank">http://mail.python.org/mailman/listinfo/pypy-dev</a><br>
<br><br></div></div></div></div></div></blockquote></div><br></div>