C Library Functions  - zo (3)

NAME

M_overload(3fm) - [M_overload::LOGICAL] returns Zero if expression is FALSE, else returns One. (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Returns
Examples
Author
License

SYNOPSIS

pure elemental integer function zo(expr)

    logical,intent(in) :: expr

DESCRIPTION

Returns an integer given a logical expression.

OPTIONS

expr A logical expression

RETURNS

The result is a default INTEGER value of 0 if the expression is TRUE, and a 1 otherwise.

EXAMPLES

Sample usage:

   program demo_zo
   use M_overload, only: zo, zo, lt, le, eq, ne, gt, ge
   implicit none
   write (*, *) zo(10 < 20)
   if (sum(zo([1 > 2, 3 == 4, 10 < 5, 100 > 50])) > 2) then
      write (*, *) ’two or more are not true’
   endif
   end program demo_zo

Results:

   >           0
   >  two or more are not true

AUTHOR

John S. Urban

LICENSE

Public Domain


Nemo Release 3.1 zo (3) July 22, 2023
Generated by manServer 1.08 from 04a019bc-c346-4f41-83f1-436e5dd5ff14 using man macros.