Sujet : Re: Operator precedence
De : mail (at) *nospam* axel-reichert.de (Axel Reichert)
Groupes : comp.lang.awkDate : 25. May 2024, 12:09:35
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <874jamm9lc.fsf@axel-reichert.de>
References : 1 2 3 4
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Kaz Kylheku <
643-408-1753@kylheku.com> writes:
in the left associative semantics, we have a choice. We can do the
exponentation earnestly as if by:
>
(expt (expt 5 2) 3)
>
Or we can take advantage of the identity:
>
(expt 5 (* 2 3))
>
The former could be important in some situation involving
floating-point: you can't always use simplifying identities.
I cannot readily imagine a scenario in which simplifying is not possible
or is disadvantageous. Could you please elaborate?
I felt that the n-ary semantics of expt provided the best value
when right associative. It's not something obtainable by a ready
identity, and there is one obvious way to do it.
Full ACK.
Best regards
Axel