Clicky

Fortran Wiki
selected_real_kind (changes)

Skip the Navigation Links | Home Page | All Pages | Recently Revised | Authors | Feeds | Export |

Showing changes from revision #2 to #3: (追記) Added (追記ここまで) | (削除) Removed (削除ここまで) | (削除) Chan (削除ここまで)(追記) ged (追記ここまで)

Description

(削除) selected_real_kind(p,r) (削除ここまで)(追記) selected_real_kind(p, (追記ここまで)(追記) r, (追記ここまで)(追記) radix) (追記ここまで) return the kind value of a real data type with decimal precision(削除) greater (削除ここまで) of at leastp (削除) digits (削除ここまで)(追記) digits, (追記ここまで)(削除) and (削除ここまで) exponent range(削除) greater (削除ここまで)(追記) of (追記ここまで) at leastr(追記) , and with a radix of (追記ここまで)(追記) radix (追記ここまで).

Standard

Fortran 95 (追記) and later; with (追記ここまで)(追記) radix (追記ここまで)(追記) (追記ここまで)(追記) Fortran 2008 (追記ここまで) and later

Class

Transformational function

Syntax

(削除)

result = selected_real_kind(p, r)

(削除ここまで)
(追記)
result = selected_real_kind([p, r, radix])
(追記ここまで)

Arguments

  • p - (Optional) shall be a scalar and of type integer.
  • r - (Optional) shall be a scalar and of type integer.
  • (追記) (追記ここまで)(追記)
  • radix - (Optional) shall be a scalar and of type integer.
  • (追記ここまで)

(削除) At (削除ここまで)(追記) Before (追記ここまで)(削除) least (削除ここまで)(削除) one (削除ここまで)(削除) argument (削除ここまで)(削除) shall (削除ここまで)(削除) be (削除ここまで)(削除) present. (削除ここまで)(追記) Fortran 2008 (追記ここまで)(追記) , at least one of the arguments (追記ここまで)(追記) r (追記ここまで)(追記) or (追記ここまで)(追記) p (追記ここまで)(追記) shall be present; since (追記ここまで)(追記) Fortran 2008 (追記ここまで)(追記) , they are assumed to be zero if absent. (追記ここまで)

Return value

selected_real_kind returns the value of the kind type parameter of a real data type with decimal precision of at least p (削除) digits (削除ここまで)(追記) digits, (追記ここまで)(削除) and (削除ここまで) a decimal exponent range of at leastr(削除) . (削除ここまで)(追記) , (追記ここまで)(削除) If (削除ここまで)(追記) and (追記ここまで)(削除) more (削除ここまで)(削除) than (削除ここまで)(削除) one (削除ここまで)(削除) real (削除ここまで)(削除) data (削除ここまで)(削除) type (削除ここまで)(削除) meet (削除ここまで)(削除) the (削除ここまで)(削除) criteria, (削除ここまで)(削除) the (削除ここまで)(削除) kind (削除ここまで)(削除) of (削除ここまで)(削除) the (削除ここまで)(削除) data (削除ここまで)(削除) type (削除ここまで) with the(削除) smallest (削除ここまで)(追記) requested (追記ここまで)(削除) decimal (削除ここまで)(削除) precision (削除ここまで)(削除) is (削除ここまで)(削除) returned. (削除ここまで)(削除) If (削除ここまで)(削除) no (削除ここまで)(削除) real (削除ここまで)(削除) data (削除ここまで)(削除) type (削除ここまで)(削除) matches (削除ここまで)(削除) the (削除ここまで)(削除) criteria, (削除ここまで)(削除) the (削除ここまで)(削除) result (削除ここまで)(削除) is (削除ここまで)(追記) radix (追記ここまで)(追記) . If the (追記ここまで)(追記) radix (追記ここまで)(追記) parameter is absent, real kinds with any radix can be returned. If more than one real data type meet the criteria, the kind of the data type with the smallest decimal precision is returned. If no real data type matches the criteria, the result is (追記ここまで)

  • -1 if the processor does not support a real data type with a precision greater than or equal to p(追記) , but the (追記ここまで)(追記) r (追記ここまで)(追記) and (追記ここまで)(追記) radix (追記ここまで)(追記) requirements can be fulfilled (追記ここまで)
  • -2 if the processor does not support a real type with an exponent range greater than or equal to r(追記) , but (追記ここまで)(追記) p (追記ここまで)(追記) and (追記ここまで)(追記) radix (追記ここまで)(追記) are fulfillable (追記ここまで)
  • -3 if(削除) neither (削除ここまで)(削除) is (削除ここまで)(削除) supported. (削除ここまで)(追記) radix (追記ここまで)(追記) but not (追記ここまで)(追記) p (追記ここまで)(追記) and (追記ここまで)(追記) r (追記ここまで)(追記) requirements are fulfillable (追記ここまで)
  • (追記) (追記ここまで)(追記)
  • -4 if radix and either p or r requirements are fulfillable
  • (追記ここまで)
    (追記) (追記ここまで)(追記)
  • -5 if there is no real type with the given radix
  • (追記ここまで)

Example

program real_kinds
 integer,parameter :: p6 = selected_real_kind(6)
 integer,parameter :: p10r100 = selected_real_kind(10,100)
 integer,parameter :: r400 = selected_real_kind(r=400)
 real(kind=p6) :: x
 real(kind=p10r100) :: y
 real(kind=r400) :: z
 print *, precision(x), range(x)
 print *, precision(y), range(y)
 print *, precision(z), range(z)
end program real_kinds
(追記) (追記ここまで)(追記)

See also

(追記ここまで)
(追記) (追記ここまで)(追記)

precision, range, radix

(追記ここまで)

category: intrinsics

Revised on April 4, 2016 17:22:35 by Jason Blevins (128.146.137.52) (2370 characters / 1.0 pages)
Edit | Back in time (2 revisions) | Hide changes | History | Views: Print | TeX | Source | Linked from: Intrinsic procedures, Fortran 2008, precision, radix, range

AltStyle によって変換されたページ (->オリジナル) /