Help with FORTRAN error message

  • Context: Comp Sci 
  • Thread starter Thread starter Daniel1992
  • Start date Start date
  • Tags Tags
    Error Fortran
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 2K views
Daniel1992
Messages
21
Reaction score
0

Homework Statement



I get the follwing error message in the FORTRAN program I am trying to code.

P(i)=(1/(sigma*sqrt(2*Pi)))*e^(-(x-xbar)^2/(2*sigma^2))
----------------------------1
Error: Invalid character in name at (1)

I assume this means there is something it doesn't like about 2*Pi but I can't work out what it is.

Any help would be appreciated.
 
Physics news on Phys.org
1 Pi should be defined elsewhere in your program, as should the constant e.
2. the character ^ is not used for exponentiation. The double * is the proper operator, thus x*x = x**2.
 
Well that was abvious :rolleyes:

forgot that '**' is used to creates powers.

Thanks for that :)