to(3f) - [M_overload::LOGICAL] return array of adjacent integers over specified range, inclusive (LICENSE:PD)
Synopsis
Description
Options
Returns
Examples
Author
License
pure elemental integer function to(i,j)
integer,intent(in) :: i integer,intent(in) :: j integer,allocatable :: to
A convenience for expressing [(integer :: i=N,M)]
I starting value J ending value
An array of adjacent whole numbers from I to J
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_toResults:
> 11 12 13 14 15 16 > 2.50000000 5.00000000 7.50000000 10.0000000 > 12.5000000 15.0000000 17.5000000 20.0000000
John S. Urban, inspired by @beliavsky
Public Domain
Nemo Release 3.1 | to (3) | February 23, 2025 |