Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: return status of the 'let' builtin



> 2026/04/06 4:53、dana <dana@xxxxxxx>のメール:
> 
> i don't feel strongly either way but i lean towards not changing it
> since it currently works as documented

Yeah, it would be better not changing it.
Floating point exceptions are ignored for a long time and making them
errors would surprise some users. Instead, I would like to explicitly
note in man page that FPEs are ignored.

# Depending on the return status of floating point arithmetic is
# not a good practice, and only very few people will do that.


diff --git a/Doc/Zsh/arith.yo b/Doc/Zsh/arith.yo
index 9f5298821..f8807eb4a 100644
--- a/Doc/Zsh/arith.yo
+++ b/Doc/Zsh/arith.yo
@@ -25,6 +25,8 @@ arithmetic expansion performed as for an argument of tt(let).  More
 precisely, `tt(LPAR()LPAR())var(...)tt(RPAR()RPAR())' is equivalent to
 `tt(let ")var(...)tt(")'.  The return status is 0 if the arithmetic value
 of the expression is non-zero, 1 if it is zero, and 2 if an error occurred.
+Floating point exceptions (division by zero, overflow, etc.) are ignored and
+not considered as errors.
 
 For example, the following statement
 
--





Messages sorted by: Reverse Date, Date, Thread, Author