Fortran error in summation?
for getting factorial MY PARTNER AND I used
real function fact(a)
implied none
integer::some sort of, i
fact = JUST ONE.
will i = JUST ONE, a
fact = point * i
stop do
stop function fact
I run through gfortran fn.f90 -o fn.x
I bought error because
d:/program documents (x86)/gfortran/bin/../lib/gcc/i586-pc-mi
bmingw32.a(main.o):most important.c:(.text+0xd2) undefined a blueprint to WinMain16′
collect2:ld returned 1 quit status
There undoubtedly are a few things which can be sub-optimal, and may even cause problem.
You will have defined ‘fact’ because real, even so the value this generates it truly is an integer (i).
A proper way to handle this could be to have
fact= fact * FLOAT(i)
so as to ensure a suitable casting in the.
Additionally, why have you got the loop start in 1 Obviously, it only ought to start on 2 (with the test to omit the loop altogether in the event that ‘a’ can be passed as being 1 or even 0)
But the actual issue could be that the error may be from the key program, not really the perform.Since you did not post what your main program, usually the one calling that function, appears, it is definitely hard to actually be conclusive within the source on the error.
From your limited details supplied, it appears you are generally either not well-known a necessary DLL or even the DLL is not in the journey.Are an individual running gfortran via Cygwin (it doesn’t seem like it in the error message), coming from MinGW, or on earth do you bootstrap your version.
Leave a Reply
You must be logged in to post a comment.