File: example_fibonacci_hash.f90

package info (click to toggle)
fortran-stdlib 0.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 34,008 kB
  • sloc: f90: 24,178; ansic: 1,244; cpp: 623; python: 119; makefile: 13
file content (13 lines) | stat: -rw-r--r-- 375 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
program example_fibonacci_hash
  use stdlib_hash_32bit, only: fibonacci_hash
  use iso_fortran_env, only: int32
  implicit none
  integer, allocatable :: array1(:)
  integer(int32) :: hash, source
  allocate (array1(0:2**6 - 1))
  array1(:) = 0
  source = 42_int32
  hash = fibonacci_hash(source, 6)
  array1(hash) = source
  print *, hash
end program example_fibonacci_hash