| 1 | initial version |
Some methods for symbolic expressions have a hold argument, that allows to prevent simplification of expressions. For example:
sage: a = sqrt(2)
sage: a.parent()
Symbolic Ring
sage: a^2
2
sage: a.power(2)
2
sage: a.power(2,hold=True)
sqrt(2)^2
It also works for addition in certain cases:
sage: x.parent()
Symbolic Ring
sage: x.add(x, hold=True)
x + x
Unfortunately, it seems not to work for elements of the Symbolic Ring that represent integers:
sage: a = SR(2)
sage: a.parent()
Symbolic Ring
sage: a
2
sage: a.add(SR(3),hold=True)
5
| 2 | No.2 Revision |
Some methods for symbolic expressions have a hold argument, that allows to prevent simplification of expressions. For example:
sage: a = sqrt(2)
sage: a.parent()
Symbolic Ring
sage: a^2
2
sage: a.power(2)
2
sage: a.power(2,hold=True)
a.power(2, hold=True)
sqrt(2)^2
It also works for addition in certain cases:
sage: x.parent()
Symbolic Ring
sage: x.add(x, hold=True)
x + x
Unfortunately, it seems not to work for elements of the Symbolic Ring that represent integers:
sage: a = SR(2)
sage: a.parent()
Symbolic Ring
sage: a
2
sage: a.add(SR(3),hold=True)
a.add(SR(3), hold=True)
5
| 3 | No.3 Revision |
Some methods for symbolic expressions have a hold argument, that this allows to prevent simplification of expressions. For example:
sage: a = sqrt(2)
sage: a.parent()
Symbolic Ring
sage: a^2
2
sage: a.power(2)
2
sage: a.power(2, hold=True)
sqrt(2)^2
It also works for addition in certain cases:
sage: x.parent()
Symbolic Ring
sage: x.add(x, hold=True)
x + x
Unfortunately, it seems not to work for elements of the Symbolic Ring that represent integers:
sage: a = SR(2)
sage: a.parent()
Symbolic Ring
sage: a
2
sage: a.add(SR(3), hold=True)
5
| 4 | No.4 Revision |
Some methods for symbolic expressions have a hold argument, this allows to prevent simplification of expressions. For example:
sage: a = sqrt(2)
sage: a.parent()
Symbolic Ring
sage: a^2
2
sage: a.power(2)
2
sage: a.power(2, hold=True)
sqrt(2)^2
sage: pi.cos(hold=True)
cos(pi)
It also works for addition in certain cases:
sage: x.parent()
Symbolic Ring
sage: x.add(x, hold=True)
x + x
Unfortunately, it seems not to work for elements of the Symbolic Ring that represent integers:
sage: a = SR(2)
sage: a.parent()
Symbolic Ring
sage: a
2
sage: a.add(SR(3), hold=True)
5
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.