@@ 1966-1990 (lines=25) @@ | ||
1963 | * @return float |
|
1964 | * |
|
1965 | */ |
|
1966 | public static function LARGE() |
|
1967 | { |
|
1968 | $aArgs = Functions::flattenArray(func_get_args()); |
|
1969 | ||
1970 | // Calculate |
|
1971 | $entry = floor(array_pop($aArgs)); |
|
1972 | ||
1973 | if ((is_numeric($entry)) && (!is_string($entry))) { |
|
1974 | $mArgs = array(); |
|
1975 | foreach ($aArgs as $arg) { |
|
1976 | // Is it a numeric value? |
|
1977 | if ((is_numeric($arg)) && (!is_string($arg))) { |
|
1978 | $mArgs[] = $arg; |
|
1979 | } |
|
1980 | } |
|
1981 | $count = self::COUNT($mArgs); |
|
1982 | $entry = floor(--$entry); |
|
1983 | if (($entry < 0) || ($entry >= $count) || ($count == 0)) { |
|
1984 | return Functions::NAN(); |
|
1985 | } |
|
1986 | rsort($mArgs); |
|
1987 | return $mArgs[$entry]; |
|
1988 | } |
|
1989 | return Functions::VALUE(); |
|
1990 | } |
|
1991 | ||
1992 | ||
1993 | /** |
|
@@ 3003-3027 (lines=25) @@ | ||
3000 | * @param int $entry Position (ordered from the smallest) in the array or range of data to return |
|
3001 | * @return float |
|
3002 | */ |
|
3003 | public static function SMALL() |
|
3004 | { |
|
3005 | $aArgs = Functions::flattenArray(func_get_args()); |
|
3006 | ||
3007 | // Calculate |
|
3008 | $entry = array_pop($aArgs); |
|
3009 | ||
3010 | if ((is_numeric($entry)) && (!is_string($entry))) { |
|
3011 | $mArgs = array(); |
|
3012 | foreach ($aArgs as $arg) { |
|
3013 | // Is it a numeric value? |
|
3014 | if ((is_numeric($arg)) && (!is_string($arg))) { |
|
3015 | $mArgs[] = $arg; |
|
3016 | } |
|
3017 | } |
|
3018 | $count = self::COUNT($mArgs); |
|
3019 | $entry = floor(--$entry); |
|
3020 | if (($entry < 0) || ($entry >= $count) || ($count == 0)) { |
|
3021 | return Functions::NAN(); |
|
3022 | } |
|
3023 | sort($mArgs); |
|
3024 | return $mArgs[$entry]; |
|
3025 | } |
|
3026 | return Functions::VALUE(); |
|
3027 | } |
|
3028 | ||
3029 | ||
3030 | /** |