I dunno (piefed.cdn.blahaj.zone)
 
you are viewing a single comment's thread
view the rest of the comments
[–] 18 points 10 months ago* (last edited 10 months ago) (12 children)

Hrmm.

I read that as resulting in 21.

My education system did fail me.

I plugged that into ghci as 2+5*(8-5), and it says 17.

:(

I did (2+5)*(8-5).

Doh.

[Edit: (Double doh! Mistyped that here as 5+2. XD)]

  • source
  • hideshow 12 child comments
  • [–] 19 points 10 months ago (4 children)

    You do parenthesis first and then multiplications and then sums, you did parenthesis, then sums, then multiplications, wich is wrong.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 2 points 10 months ago (1 child)

    You don't necessarily have to do parentheses first. What matters is that the things inside the parentheses are a group that you can't break apart. If you have 10÷2+3-2*(2+1) you can do the division first 5+3-2*(2+1) then the addition outside the parentheses 8-2*(2+1) It's just that before you do the multiplication of the term outside the parentheses, you have to handle the parentheses group, so you get 8-2*3 -> 8-6 -> 2

  • source
  • parent
  • hideshow 1 child comment
  • [–] 0 points 10 months ago

    You don’t necessarily have to do parentheses first

    Yes, you do necessarily have to do it first

    What matters is that the things inside the parentheses are a group that you can’t break apart

    And outside, and you must do them first. You haven't finished Brackets until you have 5(8-5)=15.

    10÷2+3-2*(2+1) you can do the division first

    only because you've separated that part with a plus sign

  • source
  • parent
  • [–] 12 points 10 months ago (4 children)

    plugged that into ghci as 5+2*(8-5), and it says 17.

    You might want to report that error. Or, did you mean 2+5*(8-5)?

  • source
  • parent
  • hideshow 4 child comments
  • [–] 7 points 10 months ago* (last edited 10 months ago) (3 children)

    Oops! Typo. School failed me hard!

    [Edit: Thanks. Corrected that.]

  • source
  • parent
  • hideshow 3 child comments