samedi 9 mai 2015

how can i control Decimal digits after the decimal point in rand function in fortran

In the following code I want to generate a random number that have 2 decimal digit after decimal point. for example I want random variable give (0.26) instead of (0.26463). please help me. thanks for all answers. this is my code:

PROGRAM alaki
IMPLICIT NONE
REAL :: RANDOMREAL
CALL RANDOM_SEED()
CALL RANDOM_NUMBER(RANDOMREAL)
PRINT *, "random number= ", RANDOMREAL

END PROGRAM alaki




Aucun commentaire:

Enregistrer un commentaire