Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

piecewise defined function via def

I've made the following experiment with Sage:

    def f(x):

        if (0<= x<= 1/2):
            return 1
        else:
            return 0 
assume(0<= x<= 1/2)  
show(f(x))  
show(f(1/3))

However I get outputs 0 and 1 respectively. Can someone clarify please? Thanks.