S.I/Lisp/

The =BETWIXT?() function




ABSTRACT

The =BETWIXT?([number_to_check], [lower_bound], [upper_bound]) function returns TRUE if the number_to_check is betwixt the given lower_bound and upper_bound (exclusive) and FALSE if the number_to_check is either above the upper_bound or below the lower_bound or equal to either bound.


(Use the BETWEEN? function to include the boundaries)




EXAMPLES

=BETWIXT?(10, 5, 15)
-> TRUE

=BETWIXT?(10, 10, 15)
-> FALSE

=BETWIXT?(10, 12, 15)
-> FALSE
        



SOURCE CODE

DEFINE(
    BETWIXT?,
    LAMBDA(
        number_to_check,
        lower_bound,
        upper_bound,
        AND(
            GREATERTHAN?(
                number_to_check,
                lower_bound),
            LESSTHAN?(
                number_to_check,
                upper_bound))))
        



Help us optimize this function!