Method `!()

Method `!

bool `!(object|function(:void) arg)
int(1) `!(int(0) arg)
int(0) `!(mixed arg)


Logical not.

Every expression with the ! operator becomes a call to this function, i.e. !a is the same as predef::`!(a).

It's also used when necessary to test truth on objects, i.e. in a statement if (o) ... where o is an object, the test becomes the equivalent of !!o so that any lfun::`!() the object might have gets called.


If arg is an object that implements lfun::`!(), that function will be called.

If arg is 0 (zero), a destructed object, or a function in a destructed object, 1 will be returned.

Otherwise 0 (zero) will be returned.


No float is considered false, not even 0.0.

See also

`==(), `!=(), lfun::`!()