nocturne@slrpnk.net to Showerthoughts@lemmy.world · 15 days ago(-27)^2/3message-squaremessage-square12fedilinkarrow-up130arrow-down17file-text
arrow-up123arrow-down1message-square(-27)^2/3nocturne@slrpnk.net to Showerthoughts@lemmy.world · 15 days agomessage-square12fedilinkfile-text
minus-squareprintf("%s", name);@piefed.blahaj.zonelinkfedilinkEnglisharrow-up7·15 days agoSincere question: why do you put that negative -27 in parentheses?
minus-squaremschae@discuss.mschae23.delinkfedilinkEnglisharrow-up14·15 days ago-27^2/3 would come out to a different number, because the exponentiation has a higher precedence than the negation
minus-squareprintf("%s", name);@piefed.blahaj.zonelinkfedilinkEnglisharrow-up5·edit-215 days agoAh, so without parentheses, it would be: x = -27^2 x / 3? That doesn’t sound very intuitive though…
minus-squaremschae@discuss.mschae23.delinkfedilinkEnglisharrow-up5·edit-215 days agoyup: (-27)^2/3 = ((-27) ^ 2) / 3 -27^2/3 = (-(27 ^ 2)) / 3 The reason is that you almost always want the negation to happen after the exponentiation, because it otherwise wouldn’t have any effect (at least when the exponent is even).
minus-squarenocturne@slrpnk.netOPlinkfedilinkarrow-up2·15 days ago-272/3 is a different answer and problem than (-27)2/3. (-27)2 is (-27)(-27) while -272 is (-27)(27).
minus-squareTranquilTurbulence@lemmy.ziplinkfedilinkEnglisharrow-up3·edit-215 days agoI like to think of -27^2 as -(27^2).
minus-squarewholookshere@lemmy.blahaj.zonelinkfedilinkarrow-up3·15 days agoThat’s the common shorthand yes, but its still treated like its there. The other interpretation is just as valid though.
minus-squarebob_omb_battlefield@sh.itjust.workslinkfedilinkarrow-up2·15 days agoPresumably to avoid ambiguity as to whether the thing to exponentiate is 27 or -27.
Sincere question: why do you put that negative -27 in parentheses?
-27^2/3would come out to a different number, because the exponentiation has a higher precedence than the negationAh, so without parentheses, it would be:
x = -27^2
x / 3?
That doesn’t sound very intuitive though…
yup:
(-27)^2/3=((-27) ^ 2) / 3-27^2/3=(-(27 ^ 2)) / 3The reason is that you almost always want the negation to happen after the exponentiation, because it otherwise wouldn’t have any effect (at least when the exponent is even).
Thanks! 😃
-272/3 is a different answer and problem than (-27)2/3.
(-27)2 is (-27)(-27) while -272 is (-27)(27).
I like to think of
-27^2as-(27^2).That’s the common shorthand yes, but its still treated like its there.
The other interpretation is just as valid though.
Presumably to avoid ambiguity as to whether the thing to exponentiate is 27 or -27.