Learn R Programming

nlsr (version 2023.8.31)

isZERO: Test for constants

Description

Test for the values 0, 1 or -1.

Used in newSimplification definitions.

Usage

isZERO(x)
isONE(x)
isMINUSONE(x)

Value

Returns TRUE if the argument is the appropriate scalar value.

Arguments

x

object to be tested

Examples

Run this code
isZERO(0)
x <- quote(0*1)
isZERO(x) # This is `*`(0, 1), not a value
isZERO(eval(x))
x <- quote(-1)
isMINUSONE(x) # This is `-`(1), not a value
isMINUSONE(eval(x))

Run the code above in your browser using DataLab