MirceaH
03-10-2004, 04:11 PM
I want to build a DLL which returns double precision numbers (15 digits or so). Whatever I've tried, the returned value (in VB.NET) is always in single precision (6-7 digits). This is the code:
DOUBLE PRECISION FUNCTION TEST_DLL(a) result (c)
DLL_EXPORT TEST_DLL
DOUBLE PRECISION a
DOUBLE PRECISION b
DOUBLE PRECISION c
a=3.1D0
b=1.0D0
c=DPROD(a,b)
RETURN
END
Running the same code in console returns 15 digits precision:
program MyProg
implicit none
DOUBLE PRECISION a
DOUBLE PRECISION b
DOUBLE PRECISION c
a=3.1D0
b=1.0D0
c=DPROD(a,b)
print *,c
end program MyProg
I've read the previous messages about this subject but it seems that it does not work.
DOUBLE PRECISION FUNCTION TEST_DLL(a) result (c)
DLL_EXPORT TEST_DLL
DOUBLE PRECISION a
DOUBLE PRECISION b
DOUBLE PRECISION c
a=3.1D0
b=1.0D0
c=DPROD(a,b)
RETURN
END
Running the same code in console returns 15 digits precision:
program MyProg
implicit none
DOUBLE PRECISION a
DOUBLE PRECISION b
DOUBLE PRECISION c
a=3.1D0
b=1.0D0
c=DPROD(a,b)
print *,c
end program MyProg
I've read the previous messages about this subject but it seems that it does not work.