zo(3f) - [M_overload::LOGICAL] returns Zero if expression is TRUE, else returns One. (LICENSE:PD)
Synopsis
Description
Options
Returns
Examples
Author
License
pure elemental integer function zo(expr)
logical,intent(in) :: expr
zo(3f) returns an integer 0 given a true logical expression.
expr A logical expression
The result is a default INTEGER value of 0 if the expression is TRUE, and a 1 otherwise.
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_zoResults:
> 0 > two or more are not true
John S. Urban
Public Domain
Nemo Release 3.1 | zo (3) | February 23, 2025 |