You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Output is Expected 10 / 5 / 7 (0.29), got 10 / (5 / 7) (14).
Grab a calculator and calculate 10 / 5 / 7. The result is 0.285714285714... which rounds to 0.29
Observe the incorrect result of Skript's normal arithmetic.
Expected Behavior
The equation should be done correctly, according to the order of operations, and for 10 / 5 / 7, 0.29 should be returned (provided the number accuracy is 2 in config.sk)
Server Information
Server version/platform: Paper 1.15.2 (build 143)
Skript version: Skript 2.5-alpha2
The text was updated successfully, but these errors were encountered:
bluelhf
changed the title
Skript doesn't follow order of operations with multiple dividors
Skript doesn't follow order of operations with multiple divisors
Mar 26, 2020
@bluelhf keep in mind that using a 3rd party Math library is not necessarily “easier” as Skript is first and foremost still a scripting language. It would be complicated to rewrite the entire parser for integration with a 3rd party Math parser. What would happen to expressions or functions used in conjunction to arithmetic operations for example?
Description
The arithmetic expression
a / b / c
is treated asa / (b / c)
instead of(a / b) / c
Steps to Reproduce
Run the following script:
Output is
Expected 10 / 5 / 7 (0.29), got 10 / (5 / 7) (14)
.Grab a calculator and calculate
10 / 5 / 7
. The result is0.285714285714...
which rounds to0.29
Observe the incorrect result of Skript's normal arithmetic.
Expected Behavior
The equation should be done correctly, according to the order of operations, and for
10 / 5 / 7
, 0.29 should be returned (provided the number accuracy is 2 in config.sk)Server Information
The text was updated successfully, but these errors were encountered: