Skip to content

Commit d446ead

Browse files
authored
A couple of doc tagging corrections (#1324)
1 parent 275a3b8 commit d446ead

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

mathics/builtin/intfns/combinatorial.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -416,9 +416,9 @@ class PolygonalNumber(Builtin):
416416
417417
See also <url>
418418
:Binomial:
419-
doc/reference-of-built-in-symbols/integer-functions/combinatorial-functions/binomial/</url>, and <url>
419+
/doc/reference-of-built-in-symbols/integer-functions/combinatorial-functions/binomial/</url>, and <url>
420420
:RegularPolygon:
421-
doc/reference-of-built-in-symbols/drawing-graphics/regularpolygon/</url>.
421+
/doc/reference-of-built-in-symbols/drawing-graphics/regularpolygon/</url>.
422422
"""
423423

424424
attributes = A_LISTABLE | A_NUMERIC_FUNCTION | A_PROTECTED | A_READ_PROTECTED

mathics/builtin/numbers/calculus.py

+15-7
Original file line numberDiff line numberDiff line change
@@ -952,8 +952,10 @@ class Integers(Builtin):
952952

953953
class Integrate(SympyFunction):
954954
r"""
955-
<url>:WMA link:
956-
https://reference.wolfram.com/language/ref/Integrate.html</url>
955+
<url>:Integral:https://en.wikipedia.org/wiki/Integral</url> (<url>:SymPy:
956+
https://docs.sympy.org/latest/modules/integrals/integrals.html</url>, \
957+
<url>:WMA:
958+
https://reference.wolfram.com/language/ref/Integrate.html</url>)
957959
958960
<dl>
959961
<dt>'Integrate[$f$, $x$]'
@@ -984,18 +986,20 @@ class Integrate(SympyFunction):
984986
>> Integrate[4 Sin[x] Cos[x], x]
985987
= 2 Sin[x] ^ 2
986988
987-
> Integrate[-Infinity, {x, 0, Infinity}]
989+
>> Integrate[-Infinity, {x, 0, Infinity}]
988990
= -Infinity
989991
990-
> Integrate[-Infinity, {x, Infinity, 0}]
991-
= Infinity
992+
Integrating something ill-defined returns the expression untouched:
992993
993-
Integration in TeX:
994+
>> Integrate[1, {x, Infinity, 0}]
995+
= Integrate[1, {x, Infinity, 0}]
996+
997+
Here how is an example of converting integral equation to TeX:
994998
>> Integrate[f[x], {x, a, b}] // TeXForm
995999
= \int_a^b f\left[x\right] \, dx
9961000
9971001
Sometimes there is a loss of precision during integration.
998-
You can check the precision of your result with the following sequence
1002+
You can check the precision of your result with the following sequence \
9991003
of commands.
10001004
>> Integrate[Abs[Sin[phi]], {phi, 0, 2Pi}] // N
10011005
= 4.
@@ -1114,6 +1118,10 @@ def eval(self, f, xs, evaluation: Evaluation, options: dict): # type: ignore[ov
11141118
# e.g. NotImplementedError: Result depends on the sign of
11151119
# -sign(_u`j)*sign(_u`w)
11161120
return
1121+
except TypeError:
1122+
# SymPy can give this. For example:
1123+
# Integrate[-Infinity, {x, 0, Infinity}]
1124+
return
11171125
if prec is not None and isinstance(sympy_result, sympy.Integral):
11181126
# TODO MaxExtraPrecision -> maxn
11191127
sympy_result = sympy_result.evalf(dps(prec))

0 commit comments

Comments
 (0)