ff4ff35918
Red Bear OS is a full fork. All sources must be available from git clone with zero network access. Removed gitignore rules that excluded fetched source trees under recipes/*/source/, local/recipes/kde/*/source/, local/recipes/qt/*/source/, and vendor source trees. Build artifacts (target/, build/, source.tar, *.o, *.so) remain excluded. 127291 files added — kernel, relibc, base, bootloader, pkgar, all KDE/Qt frameworks, mesa, wayland, DRM drivers, and every other recipe source.
51 lines
967 B
Plaintext
51 lines
967 B
Plaintext
#autoload
|
|
|
|
zsh_math_func_min() {
|
|
emulate -L zsh
|
|
local result=$1
|
|
shift
|
|
local arg
|
|
for arg ; do
|
|
(( arg < result ))
|
|
case $? in
|
|
(0) (( result = arg ));;
|
|
(1) ;;
|
|
(*) return $?;;
|
|
esac
|
|
done
|
|
(( result ))
|
|
true # Careful here: `return 0` evaluates an arithmetic expression
|
|
}
|
|
functions -M min 1 -1 zsh_math_func_min # at least one argument
|
|
|
|
zsh_math_func_max() {
|
|
emulate -L zsh
|
|
local result=$1
|
|
shift
|
|
local arg
|
|
for arg ; do
|
|
(( arg > result ))
|
|
case $? in
|
|
(0) (( result = arg ));;
|
|
(1) ;;
|
|
(*) return $?;;
|
|
esac
|
|
done
|
|
(( result ))
|
|
true # Careful here: `return 0` evaluates an arithmetic expression
|
|
}
|
|
functions -M max 1 -1 zsh_math_func_max # at least one argument
|
|
|
|
zsh_math_func_sum() {
|
|
emulate -L zsh
|
|
local sum
|
|
local arg
|
|
for arg ; do
|
|
(( sum += arg ))
|
|
done
|
|
(( sum ))
|
|
true # Careful here: `return 0` evaluates an arithmetic expression
|
|
}
|
|
functions -M sum 0 -1 zsh_math_func_sum
|
|
|