Manual Reference Pages  - to (3m_overload)

NAME

to(3f) - [M_overload::LOGICAL] return array of adjacent integers over specified range, inclusive (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Returns
Examples
Author
License

SYNOPSIS

pure elemental integer function to(i,j)

    integer,intent(in) :: i
    integer,intent(in) :: j
    integer,allocatable :: to

DESCRIPTION

A convenience for expressing [(integer :: i=N,M)]

OPTIONS

I starting value
J ending value

RETURNS

An array of adjacent whole numbers from I to J

EXAMPLES

Sample usage:

   program demo_to
   use M_overload, only: to, operator(.to.)
   implicit none
   character(len=*),parameter :: gen=’(*(g0,1x))’
      print gen, [11.to.16]
      print gen, 2.5 * [1.to.4]
      print gen, 2.5 * to(1,4)+10
   end program demo_to

Results:

      > 11 12 13 14 15 16
      > 2.50000000 5.00000000 7.50000000 10.0000000
      > 12.5000000 15.0000000 17.5000000 20.0000000

AUTHOR

John S. Urban, inspired by @beliavsky

LICENSE

Public Domain


Nemo Release 3.1 to (3m_overload) July 24, 2024
Generated by manServer 1.08 from 30fe6289-b5af-44bc-b8f2-4a9e6339605e using man macros.