# `Feel.Analysis.Images.Number`
[🔗](https://github.com/FeeJai/BDM/blob/feel-v0.1.0/apps/feel/lib/feel/analysis/images/number.ex#L1)

The rules for the number built-ins (`Feel.Analysis.Images`, D-161): the type of the result of a call of `abs`, `ceiling`,
`decimal`, `even`, `exp`, `floor`, `log`, `modulo`, `odd`, `round down`, `round half down`, `round half up`, `round up`
and `sqrt`, from the types of the arguments.

| Function | The numbers it gives | `null` for |
| -------- | -------------------- | ---------- |
| `abs(x)` | `|x|`, exactly (the same for a duration) | nothing |
| `floor`, `ceiling`, `round *` `(x, scale)`, `decimal(x, scale)` | the multiples of `10^-scale` from the result at the lower end to the one at the upper, exactly (`Rounding`) | a scale that is not in `-6111..6176` |
| `modulo(x, y)` | the residues, exactly for a divisor that is one number, a hull for many (`Modulo`) | a zero divisor, and a result of more than 34 digits |
| `sqrt(x)` | the run's roots at the ends (`Real`) | a negative `x` |
| `log(x)` | the run's logarithms at the ends | `x <= 0` |
| `exp(x)` | the run's results at the ends, or from the smallest number if the result can be too small | an `x` whose result is past the range or too small to write (found with the run) |
| `even(x)`, `odd(x)` | a boolean for the whole numbers of the set, exactly | a number with a fraction |

**What the type of an argument is for.** The run gives `null` for a `null` argument, and for one of a kind that the function
does not take (with an error); `abs` takes the two kinds of duration as well. A list of one element is that element
(section 10.3.2.9.4): the elements of a list type are read as the argument, and the list gives `null` for any other length,
so a type of lists has `Null`. An argument of a type that may be anything (`Any`, a named type) is every number and, for
`abs`, every duration, and may give `null`. So `Null` is in the type of the result when an argument may be `null` or of
another kind, or when a number of the argument is one the function has no result for.

**The sets are hulls** where the result is not every number between its ends: `floor(x)` for `x` in `[0.5..3.7]` is the whole
numbers `0, 1, 2, 3`, and the type says `[0..3]`. A hull holds every number the run gives, which is what a type has to do;
the granularity (that the result is a multiple of a step) is step D of D-161.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
