You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lets describe mathematically this expression: "if m=0 then a=1" [ else a=a ]
Using mathematical notation, we can write this expression as:
if(m,a) = abs(sign(m))*a + (1 + sign(m))/2 * a
if(m,a) = ((1 - m/|m|)/2 + (1 + m/|m|)/2) * a
This expression uses the sign function, which returns -1 if m is negative, 0 if m is zero, and 1 if m is positive. If m is zero, the first term evaluates to 1/2 and the second term evaluates to a,
so the expression simplifies to a = 1/2 + 1/2 * a, which yields a = 1.
If m is not zero, the first term evaluates to 0 and the second term evaluates to a, so the expression simplifies to a = a, which is true for any value of a.
The text was updated successfully, but these errors were encountered:
An alternative approach:
lets describe mathematically this expression: "if m=0 then a=1" [ else a=a ]
Using mathematical notation, we can write this expression as:
if(m,a) = abs(sign(m))*a + (1 + sign(m))/2 * a
if(m,a) = ((1 - m/|m|)/2 + (1 + m/|m|)/2) * a
This expression uses the sign function, which returns -1 if m is negative, 0 if m is zero, and 1 if m is positive. If m is zero, the first term evaluates to 1/2 and the second term evaluates to a,
so the expression simplifies to a = 1/2 + 1/2 * a, which yields a = 1.
If m is not zero, the first term evaluates to 0 and the second term evaluates to a, so the expression simplifies to a = a, which is true for any value of a.
The text was updated successfully, but these errors were encountered: