# NumberNode

(Redirected from Number)

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

```(cog-execute!
(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,

```GreaterThanLink
NumberNode 42
NumberNode 2
NumberNode 2
```

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

NumberNodes can hold a vector (list) of numbers, as well. Thus

``` NumberNode 1 2 3 4 5
```

is valid. The arithmetic operations work correctly on such vectors; so for example

```(cog-execute!
will return `(NumberNode 4 8 30 130)`, as might be expected. (The GreaterThanLink is not currently defined on vectors; the current implementation only examines the first element of the vector.)