I'm fairly new to Mathematica, so maybe I'm misinterpreting something here.
The UnitStep[x] Function is defined as
=0 if x < 0 and
=1 if x >= 0
My code is rather simple:
f := UnitStep[(0.5*Abs[x] - Abs[(y - x)])]
a = f[x = 1.0, y = 1.61]
which gives me: 0[1., 1.61] (correct)
but when I type now:
a = f[x = 1.0, y = 1.3]
it gives me: 0[1., 1.3] (incorrect)
Re-evaluating this line gives me: 1[1., 1.3] (correct).
Another re-evaluation gives me again: 1[1., 1.3]
And that's why I'm confused. How is it possible that the same function with the same arguments can have two different values!? And why is the result only incorrect for the first evaluation?
My Mathematica version is 22.214.171.124 and I'm using Windows 7.
Thanks for any suggestions!