8/28/2023 0 Comments Fortran double precisionTo inquire the kind of any real variable or constant, the function kind() can be used: print *, kind(1.0), kind(1.d0) The exact value of real_kind is not standardized and differs from compiler to compiler. This statement declares x to be of type real with a certain precision depending on the value of real_kind.įloating point literals can be declared with a specific kind using a suffix 1.23456e78_real_kind The kind of a real type is an integer named constant or literal constant: real(kind=real_kind) :: x ! Default single precision constantįortran 90 introduced parameterized real types using kinds. A real literal containing d instead of e for denoting the exponent is used to indicate double precision. Notice the d0 in the double precision constant. In common compilers using default configuration. In Fortran 2008, the decimal precision of y is at least 10 and its decimal exponent range at least 37. X here is a real of default kind and y is a real of kind with greater decimal precision than x. They can represent real numbers up to certain amount of decimal digits.įORTRAN 77 guaranteed two floating point types and more recent standards guarantee at least two real types. Floating point numbers of type real cannot have any real value.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |