Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Answer: How can I import previously created math functions?

( #111702=categorized answer: print w/ replies, xml ) Need Help??

Q&A > math > How can I import previously created math functions? contributed by ariels

The amazing Inline module offers help here, too. Not all <math.h> functions are available in Perl (even if you use POSIX;).

Here's how to print some erf() values, for instance (a function almost certainly available in your maths library):

perl -le 'use Inline C => q{ double erf(double); }, ENABLE => "AUTOWRA +P"; print "$_ ",erf($_) for (0..5)'

You can of course write it into your modules, and use it to access you own libraries.

Other C wrapping options are XS (of course) and Swig.

Comment on Answer: How can I import previously created math functions?
Download Code
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (12)
As of 2014-10-23 21:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (129 votes), past polls