Clicky

Fortran Wiki
selected_int_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_int_kind(i) (削除ここまで)(追記) selected_int_kind(r) (追記ここまで) return the kind value of the smallest integer type that can represent all values ranging from 10 (削除) I (削除ここまで)(追記) R (追記ここまで)(削除) -10^I (削除ここまで)(追記) -10^R (追記ここまで) (exclusive) to 10 (削除) I (削除ここまで)(追記) R (追記ここまで)(削除) 10^I (削除ここまで)(追記) 10^R (追記ここまで) (exclusive). If there is no integer kind that accommodates this range, selected_int_kind returns 1-1.

Standard

Fortran 95 and later

Class

Transformational function

Syntax

(削除)

result = selected_int_kind(i)

(削除ここまで)
(追記)
result = selected_int_kind(r)
(追記ここまで)

Arguments

  • (削除) i (削除ここまで)(追記) r (追記ここまで) - Shall be a scalar and of type integer.

Example

program large_integers
 integer,parameter :: k5 = selected_int_kind(5)
 integer,parameter :: k15 = selected_int_kind(15)
 integer(kind=k5) :: i5
 integer(kind=k15) :: i15
 print *, huge(i5), huge(i15)
 ! the following inequalities are always true
 print *, huge(i5) >= 10_k5**5-1
 print *, huge(i15) >= 10_k15**15-1
end program large_integers

category: intrinsics

Revised on April 4, 2016 15:26:49 by Jason Blevins (128.146.137.52) (1043 characters / 0.0 pages)
Edit | Back in time (2 revisions) | Hide changes | History | Views: Print | TeX | Source | Linked from: Intrinsic procedures, Posix90

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