Problem with big real constant and parameter statement : Fortran
This is a discussion on Problem with big real constant and parameter statement within the Fortran forums in Programming Languages category; Hi, I have to write a little program in Fortran77 which tells what is the biggest number factorizable with the differents data types (integer, real and real*8) I'm using Fortran Power Station 4.0 . This is a little piece of how I thought to write it avoiding a floating point overflow Code: parameter(real_max_value=3.4028234E+38) sfatt=1 n=1 120 if( real_max_value/sfatt .GE. n+1) then n=n+1 sfatt=sfatt*n goto 120 endif real_max_value should be the biggest number which can be represented with real data type. But even if I use: Code: parameter(real_max_value=3.4028234E+38) it assumes the 0 value and I don't know the why. I think ...
![]() |
| | LinkBack | Thread Tools |
|
#1
| |||
| |||
| I have to write a little program in Fortran77 which tells what is the biggest number factorizable with the differents data types (integer, real and real*8) I'm using Fortran Power Station 4.0 . This is a little piece of how I thought to write it avoiding a floating point overflow Code: parameter(real_max_value=3.4028234E+38)
sfatt=1
n=1
120 if( real_max_value/sfatt .GE. n+1) then
n=n+1
sfatt=sfatt*n
goto 120
endif
Code: parameter(real_max_value=3.4028234E+38) Is using 3.4028234E+38 instead of the literal constant the only one solution? Thanks in advance |
![]() |
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Real-time sinusoidal parameter estimation? | usenet | DSP | 36 | 10-23-2008 02:45 PM |
| Pass a parameter in sql statement with VB 2005... | usenet | DOTNET | 14 | 07-21-2008 02:31 AM |
| How to represent constant parameter in a function prototype? | usenet | Fortran | 1 | 03-18-2008 09:22 AM |
| Check if a parameter is a constant or an object? | usenet | RUBY | 1 | 10-30-2007 12:07 PM |
| Missing IN or OUT parameter in SQL statement | usenet | Weblogic | 2 | 04-12-2004 09:58 PM |




