From OpenCog
Jump to: navigation, search

The NumberNode is a type of Node that holds double-precision floating point numbers. It is typically used in arithmetical operations, such as PlusLink and TimesLink. For example, the following scheme expression

      (NumberNode 2)
         (NumberNode 3)
         (NumberNode 4))))

will yield

 (NumberNode "14.000000")

as a result. NumberNodes can be compared with the EqualLink and the GreaterThanLink. So for example,

     NumberNode 42
          NumberNode 2
          NumberNode 2

will evaluate to "true" when evaluated by the pattern matcher or by cog-evaluate!.

See also