Skip to content

Instantly share code, notes, and snippets.

@a3f
Created July 25, 2015 19:44
Show Gist options
  • Save a3f/89004776d5f4d8d5e0ae to your computer and use it in GitHub Desktop.
Save a3f/89004776d5f4d8d5e0ae to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use Inline C => Config => LIBS => '-lm';
use Inline C;
use strict;
use warnings;
my $a = 81;
my $c = root($a);
print $c,"\n";
__END__
__C__
#include <math.h>
int root(double x)
{
return sqrt(x);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment