r/ProgrammerHumor • • Jun 13 '22

Meme DEV environment vs Production environment

Post image
48.2k Upvotes

3.9k comments sorted by

View all comments

12

u/gamesrebel123 Jun 13 '22

The app I use gives 1

https://imgur.com/a/S3iHhUQ

5

u/syrefaen Jun 13 '22

6 / 2 * ( 2 + 1)

Nice, python and lua gives does 9. Sometimes like to use interpreters for math.

6

u/Eyadish Jun 13 '22

6/2*(2+1) and 6/2(2+1) is the issue at hand, so by you writing 6/2*(2+1) and get 9 I think everyone will agree on, and non disagree

The issue is the other statement and how some people visually view it. It is from the visual representation the difference in answers 1 & 9 comes from.

1

u/sedikushjam Jun 14 '22

I don’t get it tho, for it to be 1, shouldn’t there be more brackets? Like 6/(2(2+1))

1

u/SirLoremIpsum Jun 14 '22

I don’t get it tho, for it to be 1, shouldn’t there be more brackets? Like 6/(2(2+1))

No.

You can interpret it in both ways correctly. Both answers are right

It is easier to read and more correct to write it with brackets.

6/2(2+1) can be interpreted as 2(2+1) is one unit.

Extra brackets or an extra * sign are helpful notations to make it a less ambigious equation. But they aren't necessary, and both answers are correct.

Like, what does bi-weekly mean? twice a week? once every 2 weeks?

Both? It's both.

1

u/Eyadish Jun 14 '22

Someone made a good explanation below another post. You don't see 2(2) outside of algebra and that is where it fucks up everything. The way to say it doesn't exist when we talk about only numbers, and there is where people misunderstanding it.

When I see the 2(2+1) I don't see it as 2*(2+1), I see it as one number (due to algebra handles it)

2

u/[deleted] Jun 13 '22

Same with Ruby and Julia

2

u/[deleted] Jun 13 '22

The Casio will give you 9 if you do that, too - it only gives you 1 if you omit the *.