[ library(ria) | The ECLiPSe Libraries | Reference Manual | Alphabetic Index ]

median(?Var, -Median)

Returns the median of the range of the ranged variable Var.
Var
A ranged variable or number
Median
The median of the range

Description

Returns the median of the range of the ranged variable Var so that the range can be split.

If the range crosses 0, then the median is 0. Otherwise, the median splits the range logarithmically so that the two subranges have the same number of representable floats.

Examples

[eclipse 5]: X::10..1000, median(X,M).

X = X{10 .. 1000}
M = 100.00000000000004
yes.
[eclipse 6]: X:: -1..1000, median(X,M).

X = X{-1 .. 1000}
M = 0.0
yes.