Skip to content

Factorial function? #50

@joeyhub

Description

@joeyhub

For the sake of performance it would be great to have a factorial function in the library. It's in the documentation but as a PHP implementation.

I use gmp for it at the moment. I'm not sure if it's linear or not but either way C will be much faster for very large numbers.

On another note, this library is able to compute pow much faster than bcmath for very large exponents. This library can calculate something that ends up at E-500000 very quickly but bcmath takes prohibitively long.

I would recommend it to people having problems with bcmath and bcpow.

Another thing that bothers me is why so many of this libraries don't support initialisation from native php float which is a bit mind boggling. I have to use number_format($n, 72, '.', '').

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions