# Is there a bug in heaviside function?

Hi all, I have defined a function f = heaviside(x), and then ploted it over [-1,1]. It should plot 0 in [-1,0] and 1 in [0,1]. However, the plot I get is 1 over the whole domain [-1,1]. If I redefine f as f = heaviside(x-0.00000001) -i.e. shifted by a very small value- I get the expected plot. The same happens with unit step function. Is this a bug, or I am missing somthing?

works fine for me in SageMath version 10.3.beta7

WorksForMe(TM) in 10.3.beta6.

How do you define

`f`

? More generaly, can you give us yourcode?Make sure that

`x`

is a variable when defining`f`

. In my case, the following worked:And the graph was as expected.