Garbage Value coming from DPI call

HI ,
I wrote a small bench to find the X power Y value , By using DPIs , and the foreign language is C

CODE :
module tb;
import “DPI-C” pow = function int power(int , int);

initial
$display("5 POWER 2 is %d ",power(5,2));
endmodule

where as the pow is the predefined function in <math.h>

the problem is if i directly call the pow function from sv it is returning some garbage value, where as it return correct value if i wrapped the pow function in some other function.

I tried to find the reason but couldn’t . Please help me .

If you are trying to import the standard C pow() routine, then your prototype is wrong. It should be

 import "DPI-C" pow = function real power(real , real);