- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
there is no difference between asd(), msd()
but why they print out different results?
thanks a lot.
a poor man
! result---------------------
1.23456001281738
0.000000000000000E+000
! code --------------------------------
program main
double precision time
time = asd()
print *, time
time = msd()
print *, time
end program main
double precision function asd()
asd = 1.23456
end function asd
double precision function msd()
msd = 1.23456
end function msd
but why they print out different results?
thanks a lot.
a poor man
! result---------------------
1.23456001281738
0.000000000000000E+000
! code --------------------------------
program main
double precision time
time = asd()
print *, time
time = msd()
print *, time
end program main
double precision function asd()
asd = 1.23456
end function asd
double precision function msd()
msd = 1.23456
end function msd
Link kopiert
2 Antworten
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
there is no difference between asd(), msd() but why they print out different results? thanks a lot. a poor man
! result---------------------
1.23456001281738
0.000000000000000E+000
! code --------------------------------
program main
double precision time
time = asd()
print *, time
time = msd()
print *, time
end program main
double precision functionasd()
asd = 1.23456
end function asd
double precision function msd()
msd = 1.23456
end function msd
! result---------------------
1.23456001281738
0.000000000000000E+000
! code --------------------------------
program main
double precision time
time = asd()
print *, time
time = msd()
print *, time
end program main
double precision functionasd()
asd = 1.23456
end function asd
double precision function msd()
msd = 1.23456
end function msd
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
You need to add:
double precision msd
to the main program. msd should also use:
msd = 1.23456D0
otherwise you are assigning a single precision value to a double precision variable.
Steve
double precision msd
to the main program. msd should also use:
msd = 1.23456D0
otherwise you are assigning a single precision value to a double precision variable.
Steve
Antworten
Themen-Optionen
- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite