SchemeExt:Test:greater-than

From DocR21

Jump to: navigation, search

Contents

Action

Compares two real numbers.

Filename

scm/scmext/kern/law_scm.cpp

APIs

None

Syntax

(test:greater-than variable fixed [tolerance] [msg])

Argument Types

Argument Scheme Data Type
variable real
fixed real
tolerance real
msg string

Returns

boolean

Description

Compares variable to fixed, returning true if the variable is greater than the fixed. If the variable is less than the fixed by an amount less than the tolerance, the result is also true.

Arguments

  • variable and fixed specify the arguments to be tested.
  • tolerance specifies the tolerance value to be used.
  • If a msg string is specified, this string prints out to the debug file if the result is false.

Example

; test:greater-than
(test:greater-than 2 1)
;; #t
(test:greater-than 2.0 2.1 0.2
    "greater within tolerance")
;; #t
;
Personal tools
Live