[UP]


Manual Reference Pages  - bound (3)

NAME

bound(3f) - [M_math] constrain a value to a range

CONTENTS

Synopsis
Description
Example

SYNOPSIS

elemental function bound(bottom, middle, top)

   TYPE, intent(in) :: bottom, middle, top
   TYPE             :: bound

where TYPE may be REAL or INTEGER of default kind

DESCRIPTION

Constrain a value to the range from BOTTOM to TOP. The user is responsible for ensuring BOTTOM is less than or equal to TOP.

EXAMPLE

Sample program

Linux Linux program demo_bound use M_math, only : bound implicit none write(*, *)bound(1, 3, 10) write(*, *)bound(1, -30, 10) write(*, *)bound(1, 30, 10) write(*, *)bound(-11.11, 5.5, 9.999) end program demo_bound

Example output

3 1 10 5.50000000


bound (3) March 11, 2021
Generated by manServer 1.08 from a10bf0a8-91c5-42f9-9452-d039c7a638c4 using man macros.