Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Simplifaction of boolean values

def F(n) : return exp(log(n))

def test1(n) : return n == F(n)

[test1(i) for i in (4..8)]

gives [4 == 4, 5 == 5, 6 == 6, 7 == 7, 8 == 8]

def G(n) : return n

def test2(n) : return n == G(n)

[test2(i) for i in (4..8)]

gives [True, True, True, True, True]

What do I have to do so that test1 gives the same result as test2?

click to hide/show revision 2
No.2 Revision

Simplifaction Simplification of boolean values

def F(n) : return exp(log(n))

def test1(n) : return n == F(n)

[test1(i) for i in (4..8)]

gives [4 == 4, 5 == 5, 6 == 6, 7 == 7, 8 == 8]

def G(n) : return n

def test2(n) : return n == G(n)

[test2(i) for i in (4..8)]

gives [True, True, True, True, True]

What do I have to do so that test1 gives the same result as test2?

click to hide/show revision 3
No.3 Revision

Simplification of boolean values

def F(n) : 
    return exp(log(n))

exp(log(n))

def test1(n) : return n == F(n)

F(n)

[test1(i) for i in (4..8)]

(4..8)]

gives [4 == 4, 5 == 5, 6 == 6, 7 == 7, 8 == 8]

def G(n) : 
    return n

n

def test2(n) : return n == G(n)

G(n)

[test2(i) for i in (4..8)]

(4..8)]

gives [True, True, True, True, True]

What do I have to do so that test1 gives the same result as test2?