C Library Functions  - zo (3)

NAME

zo(3f) - [M_overload::LOGICAL] returns Zero if expression is TRUE, 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

zo(3f) returns an integer 0 given a true 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) February 23, 2025
Generated by manServer 1.08 from f7ae0959-3a6d-4487-8a09-468ce3f613c5 using man macros.