between()

Read(225) Label: check, boolean value,

Description:

Check if Parameter1 is between Parameter 2 and Parameter 3 according to a passed-in parameter.

Syntax:

between(x,a:b)

Find if x falls between a and b. By default the interval enclosed by a and b is closed.

Note:

The function checks whether x falls between a and b.

Parameters:

x

An expression that returns value of any data type that is capable of being compared, including numbers, strings, dates, and sequences.

a

An expression that returns value of any data type that is capable of being compared, including numbers, strings, dates, and sequences.

b

An expression that returns value of any data type that is capable of being compared, including numbers, strings, dates, and sequences.

Options:

@l

The interval is left-open and right-closed

@r

The interval is right-open and left-closed

@b

Make the function returns -1 if x<a; returns 1 if b<x; and retrun 0 for the rest of the cases

Return value:

  Boolean value

Example:

between(4,5:6)

false

between(4,3:6)

true

between(4,4:6)

true

between@l(5,5:6)

false

between@r(6,5:6)

false

between@b(5,6:9)

-1

Related functions:

if()

case()

string()