Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
21232: change LaTeX, return shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
rwst committed Aug 17, 2016
1 parent 3fcaf85 commit 141a784
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/sage/functions/other.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,23 +707,17 @@ def __init__(self):
frac(x + 5.40000000000000)
sage: frac(cos(8)/cos(2))
cos(8)/cos(2)
sage: latex(frac(x))
\operatorname{frac}\left(x\right)
Test pickling::
sage: loads(dumps(floor))
floor
"""
BuiltinFunction.__init__(self, "frac",
conversions=dict(sympy='frac'))

def _print_latex_(self, x):
r"""
EXAMPLES::
sage: latex(frac(x))
\left\{ x \right\}
"""
return r"\left\{ %s \right\}"%latex(x)
conversions=dict(sympy='frac'),
latex_name=r"\operatorname{frac}")

def _evalf_(self, x, **kwds):
"""
Expand All @@ -749,7 +743,7 @@ def _eval_(self, x):
return x - x.floor()
except AttributeError:
if isinstance(x, (int, long)):
return x - Integer(x)
return Integer(0)
elif isinstance(x, (float, complex)):
return x - Integer(int(math.floor(x)))
elif isinstance(x, sage.symbolic.expression.Expression):
Expand Down

0 comments on commit 141a784

Please sign in to comment.