# NOTE: requires the `zsh/mathfunc` module to be active
zmodload zsh/mathfunc
echo $(( abs(-5) ))
# 5
echo $(( pi = 4.0 * atan(1.0) ))
# 3.1415926535897931
echo $(( sin(1/4.0)**2 + cos(1/4.0)**2 - 1 ))
# -1.1102230246251565e-16
shfmt --language-dialect zsh <<<'echo $(( abs(-5) ))'
# <standard input>:1:13: not a valid arithmetic operator: `(`
shfmt --language-dialect zsh <<<'echo $(( pi = 4.0 * atan(1.0) ))'
# <standard input>:1:25: not a valid arithmetic operator: `(`
shfmt --language-dialect zsh <<<'echo $(( sin(1/4.0)**2 + cos(1/4.0)**2 - 1 ))'
# <standard input>:1:13: not a valid arithmetic operator: `(`
zsh docs
https://zsh.sourceforge.io/Doc/Release/Zsh-Modules.html#The-zsh_002fmathfunc-Module
zsh docs
https://zsh.sourceforge.io/Doc/Release/Zsh-Modules.html#The-zsh_002fmathfunc-Module