Elektrine lite

← Feed

@ColinTheMathmo@mathstodon.xyz

2023-11-30 17:03 UTC

@SmartmanApps@dotnet.social I can answer that. You are saying that these have different answers: 8 / 2(3+1) and 8 / 2 * (3+1) You are saying that in the first case the 2 "binds to" the bracketed term and should be distributed first, before doing anything else. That means the first will evaluate to 8/(2*3+2*1) which is 1. But in the second case the division and multiplication must be evaluated left to right, being of equal precedence. Therefore the second evaluates to: (8 / 2) * (3+1) which is 16. So you are saying that the implicit multiplication in the first case has a higher precedence than the explicit multiplication in the second case. CC: @ingwar@mastodon.social

Replies (1)

  • @SmartmanApps@dotnet.social 2023-12-01 11:33

    @ColinTheMathmo@mathstodon.xyz @ingwar@mastodon.social 1/3 "You are saying that in the first case the 2 "binds to" the bracketed term" No, I'm saying that the 2 is PART OF the bracketed term - a term that includes brackets. Terms are separated by operators, and there is no operator separating them 2*(1+2)=2*3 (2 terms multiplied) 2(1+2)=6 (1 term, no multiplication) See https://dotnet.social/@SmartmanApps/110846452267056791 "division and multiplication must be evaluated left to right" No. See https://dotnet.social/@SmartmanApps/110965810374299599 ...

    Open ##5026467