gpt4 book ai didi

abap - ABAP 中的评估顺序

转载 作者:行者123 更新时间:2023-12-05 01:22:33 25 4
gpt4 key购买 nike

ABAP 是否有定义的评估顺序?例如,在表达式 foo( ) + bar( ) 中,是否可以保证方法 foo( )bar( )首先评估/执行?在 ABAP 关键字文档中找不到此类信息。

最佳答案

ABAP documentation: arith_exp - Arithmetic Operators :

The table shows the possible arithmetic operators for arithmetic expressions, their priority, and the order in which the calculation is performed.

Within a parenthesis level, calculations with operators of higher priority are performed before calculations with operators of lower priority.

For adjacent operators of the same priority, the calculation is performed in the order specified.

In the third column of the table below, 3 indicates the highest priority and 1 the lowest.

Operator Priority Order
+ 1 From left to right
- 1 From left to right
* 2 From left to right
/ 2 From left to right
DIV 2 From left to right
MOD 2 From left to right
** 3 From right to left

关于abap - ABAP 中的评估顺序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73686086/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com