in(3f) - [M_math] test if a value occurs in an expected range
Synopsis
Description
Example
elemental function in(bottom, middle, top)
ALLOWED_TYPE, intent(in) :: bottom, middle, top logical :: inwhere ALLOWED_TYPE may be REAL or INTEGER of default kind from the set
use,intrinsic :: iso_fortran_env, only : int8, int16, int32, int64, & & real32, real64, real128, dp=>real64All input values must be of the same KIND.
Test if a value is within the range BOTTOM to TOP inclusive. The user is responsible for ensuring BOTTOM is less than or equal to TOP.
Sample program
program demo_in use M_math, only : in implicit none write(*, *)in(1, 3, 10) write(*, *)in(1, -30, 10) write(*, *)in(1, 30, 10) write(*, *)in(-11.11, 5.5, 9.999) end program demo_inExample output
Nemo Release 3.1 | in (3) | February 23, 2025 |