[pypy-dev] Pure Python Math Library

Blaine frikker at gmail.com
Wed Nov 16 20:01:38 CET 2011


Thanks Charlie, that's really helpful!

Yeah ceil is easy. Pow can be done if log() and exp() are available, and
exp() shouldn't be too hard I think.
def pow(x,y):
    return exp(y*log(x))

Blaine


On Wed, Nov 16, 2011 at 1:03 PM, Charlie Hui <cjhui at yahoo.com> wrote:

> http://en.literateprograms.org/Logarithm_Function_(Python)
> ceil seems pretty easy to implement...
> pow? Integer only?
>
> --C
>
> ------------------------------
> *From:* Blaine <frikker at gmail.com>
> *To:* pypy-dev at python.org
> *Sent:* Wednesday, November 16, 2011 9:21 AM
> *Subject:* [pypy-dev] Pure Python Math Library
>
> Does anyone know of a pure python math library? I've been playing around
> with berp <https://github.com/bjpop/berp/wiki>, 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.
>
> I'm looking for log, log10, ceil, and pow mostly for my personal needs.
>
> 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.
>
> Anyway, just wondering if anyone had heard of such a thing. How do you
> even implement log?
>
> Thanks,
> Blaine
>
> _______________________________________________
> pypy-dev mailing list
> pypy-dev at python.org
> http://mail.python.org/mailman/listinfo/pypy-dev
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20111116/7cb4f9b1/attachment-0001.html>


More information about the pypy-dev mailing list