Re: double confusion



Julian Bessenroth wrote:


michael schrieb:

Declare

double precision r

in the calling program.

TNX, it's working, but (It seems to be quite a while since I wrote
frotran77 the last time) this is not similar to moth other languages.

Why do I have to declare r wihin the calling program? I've already
declared r as double precision in the function definition. It's more
clear to me to declare c and a,b but r ... ?

What logic is behind that? It's unlike other languages, isn't is?


How is it different from C ?

If the subprogram and the main program were in different files and compiled
separately how could you ensure that the main program knows what return
type the function has ?

Ian

.



Relevant Pages

  • Re: Cannot make out what is wrong!Please Help:-(
    ... Below is the code of the calling program. ... I recall that on DEC 10 and VAX/VMS, you could get away with this, because double precision was simply a single precision word plus a word containing the bits of the extra precision. ... John Mansell john at wcompsys dot co dot uk ...
    (comp.lang.fortran)
  • Re: double confusion
    ... frotran77 the last time) this is not similar to moth other languages. ... Why do I have to declare r wihin the calling program? ... declared r as double precision in the function definition. ...
    (comp.lang.fortran)
  • Re: Cannot make out what is wrong!Please Help:-(
    ... > making any mistake in the calling program please check. ... the calling program and in the subroutine. ... which is the same as double precision. ... One of the purposes of this newsgroup is to promote Fortran as ...
    (comp.lang.fortran)
  • Re: All the output is correct, accept I get this global variable error message, please help correct
    ... %Program 3 - Calling Program ... The value of local variables may have been changed to match the ... The problem is that if you're going to declare the variable as global, ...
    (comp.soft-sys.matlab)
  • Re: All the output is correct, accept I get this global variable
    ... but I get this error message about global variables. ... figure,plot,title('Projectile Motion for = ... %Program 3 - Calling Program ... The problem is that if you're going to declare the variable as global, ...
    (comp.soft-sys.matlab)