Where i = the order of the approximation. Note that an error code is passed (IER = 1) for the case where no roots are possible.Ģ.5 The development of the algorithm hinges on recognizing that the series approximation of the sine can be represented concisely by the summation, n.This is often the preferred style, because the I/O is left to the discretion of the programmer within the calling program. Rather, information is passed in and out via the arguments. The subroutine does not involve input or output.Several features of this subroutine bear mention: 0) THEN PRINT *, r1,i1," i" PRINT *, r2,i2," i" ELSE PRINT *, "No roots" END IF END SUBROUTINE Roots(a, b, c, ier, r1, i1, r2, i2) IMPLICIT NONE INTEGER::ier REAL::a, b, c, d, r1, i1, r2, i2 r1=0. PROGRAM Rootfind IMPLICIT NONE INTEGER::ier REAL::a, b, c, r1, i1, r2, i2 DATA a,b,c/1.,5.,2./ CALL Roots(a, b, c, ier, r1, i1, r2, i2) IF (ier. However, we did not exploit this feature, in order to make the code more compatible with Visual BASIC, MATLAB, etc. It should be noted that the availability of complex variables in Fortran 90, would allow this subroutine to be made even more concise. The following Fortran 90 program is one example. INPUT value F average = sum/count value = “end of data” F sum = sum + value count = count + 1Ģ.4 Students could implement the subprogram in any number of languages. LIBROS UNIVERISTARIOS Y SOLUCIONARIOS DE MUCHOS DE ESTOS LIBROS LOS SOLUCIONARIOS CONTIENEN TODOS LOS EJERCICIOS DEL LIBRO RESUELTOS Y EXPLICADOS DE FORMA CLARA VISITANOS PARA DESARGALOS GRATIS.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |