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

Re: zmathfunc: min, max, sum throw error if result equals 0



On Fri, Apr 16, 2021 at 11:26 AM Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> wrote:
>
> When «$foo» appears inside «$((…))», it's expanded as a string that's
> then parsed as math.  The result of «$((…))» is then assigned to the
> $result, which is eventually used as «(( result ))», where — because
> ${(t)result} is non-integer scalar — there will be another
> string-to-integer conversion.

Yes, there's another string-to-integer conversion, but I haven't
figured out how «result=$((...))» can possibly assign any string that
is not already a plain number, so the string-to-integer conversion is
free of meaningful side-effects.  Have I missed something?




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