4 ms·
> Given variables x and y with values 5 and 10, ie both having the same positive sign, x-y will produce a result -5, that has negative sign. If x and y both ha
by orlp 3y ago
> Given variables x and y with values 5 and 10, ie both having the same positive sign, x-y will produce a result -5, that has negative sign.
If x and y both have a positive sign the condition "for x−y that means if x and y have different signs" is not met.
With -3 and -6, again, x and y both have the same sign and the condition is not met for subtraction.
- emilfihlman 3y agoDirect your attention to the first line "If both of the addends have the same sign, the output must have that sign" This is absolutely not true, as already shown. x=5 y=10 z=x-y=-5, which has different sign from x. If we assume sign of y inverts because of the operation, then direct your attention to the second line "However, for x−y that means if x and y have different signs the output must have the sign of x" x=-3 y=-6=>6 these now have different sign, so result should have sign of x, but z=x+y=3, which again has different sign from x.
- orlp 3y ago> Direct your attention to the first line "If both of the addends have the same sign, the output must have that sign" This is absolutely not true, as already shown. x=5 y=10 z=x-y=-5, which has different sign from x. The first sentence is referring to addition, with addends, not subtraction. x - y is not an addition, it is a subtraction, so the first sentence does not directly apply. It does apply however if you treat x - y as the sum x + (-y), which the second sentence clarifies. In other words, the first sentence applies directly to additions, and applies to subtractions if you flip the sign of the second argument. The second sentence applies to subtractions directly without any sign flips, but obviously does not apply to additions. > If we assume sign of y inverts because of the operation, then direct your attention to the second line "However, for x−y that means if x and y have different signs the output must have the sign of x" > x=-3 y=-6=>6 these now have different sign, so result should have sign of x, but z=x+y=3, which again has different sign from x. No, x=-3 and y=-6 both have the same sign, they're both negative.