Ensure factorial is nondecreasing for small n (0..8).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(inout) | :: | id | |||
| integer, | intent(inout) | :: | nfail |
subroutine test_008(id, nfail) use forcolormap_utils, only: factorial integer, intent(inout) :: id, nfail character(len=*), parameter :: name = "factorial: monotone for n=0..8" logical :: ok integer :: n, prev, cur ok = .true. prev = factorial(0) do n = 1, 8 cur = factorial(n) ok = ok .and. (cur >= prev) prev = cur end do call report_test(name, ok, id, nfail) end subroutine test_008