Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small doc changes #1058

Merged
merged 4 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions mathics/builtin/atomic/numbers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-

# Note: docstring is not flowed in documentation. To avoid line breaks
# in docstrings apparing in the printed output, use \ before the line
# in docstrings appearing in the printed output, use \ before the line
# break.

"""
Expand Down Expand Up @@ -90,7 +90,6 @@ def convert_repeating_decimal(numerator, denominator, base):
del tails[j]
tails.insert(0, head[i])
del head[i]
j = j - 1

# truncate all leading 0's
if all(elem == "0" for elem in head):
Expand Down Expand Up @@ -153,10 +152,10 @@ class Accuracy(Builtin):
decimal point in the number x.
</dl>

<i>Notice that the result could be slightly different than the obtained \
in WMA, due to differencs in the internal representation of the real numbers.</i>
<i>Notice that the result could be slightly different from the result obtained \
in WMA, due to differences in the internal representation of the real numbers.</i>

Accuracy of a real number is estimated from its value and its precision:
'Accuracy' of a real number is estimated from its value and its precision:

>> Accuracy[3.1416`2]
= 1.50298
Expand Down Expand Up @@ -207,7 +206,7 @@ class Accuracy(Builtin):
summary_text = "find the accuracy of a number"

def eval(self, z, evaluation):
"Accuracy[z_]"
"""Accuracy[z_]"""
acc = eval_Accuracy(z)
if acc is None:
return SymbolInfinity
Expand Down Expand Up @@ -248,7 +247,7 @@ class IntegerExponent(Builtin):
summary_text = "number of trailing 0s in a given base"

def eval_two_arg_integers(self, n: Integer, b: Integer, evaluation):
"IntegerExponent[n_Integer, b_Integer]"
"""IntegerExponent[n_Integer, b_Integer]"""

py_n, py_b = n.value, b.value
py_n = abs(py_n)
Expand Down Expand Up @@ -335,7 +334,7 @@ class IntegerLength(Builtin):
summary_text = "total number of digits in any base"

def eval(self, n, b, evaluation):
"IntegerLength[n_, b_]"
"""IntegerLength[n_, b_]"""

n, b = n.get_int_value(), b.get_int_value()
if n is None or b is None:
Expand Down Expand Up @@ -471,7 +470,7 @@ def eval(self, n, evaluation):
return self.eval_with_base(n, from_python(10), evaluation)

def eval_with_base(self, n, b, evaluation, nr_elements=None, pos=None):
"%(name)s[n_?NumericQ, b_Integer]"
"""%(name)s[n_?NumericQ, b_Integer]"""

expr = Expression(SymbolRealDigits, n)
rational_no = (
Expand Down Expand Up @@ -585,7 +584,7 @@ def eval_with_base(self, n, b, evaluation, nr_elements=None, pos=None):
return ListExpression(list_expr, Integer(exp))

def eval_with_base_and_length(self, n, b, length, evaluation, pos=None):
"%(name)s[n_?NumericQ, b_Integer, length_]"
"""%(name)s[n_?NumericQ, b_Integer, length_]"""
elements = []
if pos is not None:
elements.append(from_python(pos))
Expand All @@ -599,7 +598,7 @@ def eval_with_base_and_length(self, n, b, length, evaluation, pos=None):
)

def eval_with_base_length_and_precision(self, n, b, length, p, evaluation):
"%(name)s[n_?NumericQ, b_Integer, length_, p_]"
"""%(name)s[n_?NumericQ, b_Integer, length_, p_]"""
if not isinstance(p, Integer):
evaluation.message(
"RealDigits", "intm", Expression(SymbolRealDigits, n, b, length, p)
Expand Down Expand Up @@ -773,7 +772,7 @@ class Precision(Builtin):
<i>Note that the result could be slightly different than the obtained \
in WMA, due to differences in the internal representation of the real numbers.</i>

The precision of an exact number, e.g. an Integer, is 'Infinity':
The precision of an exact number, e.g., an Integer, is 'Infinity':

>> Precision[1]
= Infinity
Expand Down Expand Up @@ -820,7 +819,7 @@ class Precision(Builtin):
summary_text = "find the precision of a number"

def eval(self, z, evaluation):
"Precision[z_]"
"""Precision[z_]"""
if isinstance(z, MachineReal):
return SymbolMachinePrecision

Expand Down
8 changes: 4 additions & 4 deletions mathics/doc/documentation/1-Manual.mdoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
\Mathics is a <url>:computer algebra
system:https://en.wikipedia.org/wiki/Computer_algebra_system</url>. It is a free, open-source alternative to \Mathematica or the \Wolfram Language. However, \Mathics builds around and on top of the Python ecosystem of libraries and tools. So in a sense, you can think of it as a WMA front-end to the Python ecosystem of tools.

\Mathics is free both as in "free beer" but also, more importantly, as in "freedom". \Mathics can be run locally. But to facilitate installation of the vast amount of software need to run this, there is a <url>:docker image available on dockerhub: https://hub.docker.com/r/mathicsorg/mathics</url>.
\Mathics is free both as in "free beer" but also, more importantly, as in "freedom". \Mathics can be run locally. But to facilitate installation of the vast amount of software needed to run this, there is a <url>:docker image available on dockerhub: https://hub.docker.com/r/mathicsorg/mathics</url>.

The programming language and built-in functions of \Mathics tries to match the \Wolfram Language, which is continually evolving changing.

\Mathics is in no way affiliated or supported by \Wolfram. \Mathics will probably never have the power to compete with \Mathematica in industrial applications; it is a free alternative though. It also invites community development at all levels.

See the <url>:installation instructions: https://mathics-development-guide.readthedocs.io/en/latest/installing/index.html</url> for the most recent instructions for installing from PyPI, or the source.

For implementation details, plrease refer to the <url>:Developers Guide:https://mathics-development-guide.readthedocs.io/en/latest/</url>.
For implementation details, please refer to the <url>:Developers Guide:https://mathics-development-guide.readthedocs.io/en/latest/</url>.

<section title="Why try to recreate Wolfram Language?">
\Mathematica is great, but it a couple of disadvantages.
Expand Down Expand Up @@ -82,7 +82,7 @@ While we always could use help, such as in Python programming, improving Documen
<ul>
<li>Ensure this document is complete and accurate. We could use help to ensure all of the Builtin functions described properly and fully, and that they have link to corresponding Wiki, Sympy, WMA and/or mpath links.
Make sure the builtin summaries and examples clear and useful.</li>
<li>We could use help in LaTeX styling, and going over this document to remove overful boxes and things of that nature. We could also use help and our use of Asymptote. The are some graphics primitives such as for polyhedra that haven't been implemented. Similar graphics options are sometimes missing in Asymptote that we have available in other graphics backends.</li>
<li>We could use help in LaTeX styling, and going over this document to remove overfull boxes and things of that nature. We could also use help and our use of Asymptote. The are some graphics primitives such as for polyhedra that haven't been implemented. Similar graphics options are sometimes missing in Asymptote that we have available in other graphics backends.</li>

<li>add another graphics backend: it could be a javascript library like jsfiddle</li>

Expand Down Expand Up @@ -226,7 +226,7 @@ The result of the previous query to \Mathics can be accessed by '%':

<section title="Precision and Accuracy">

\Mathics handles relative and absolute uncertanties in numerical quantities. The <em>precision</em> or relative accuracy, is set by adding a RawBackquote character ('`') and the number of digits of precision in the mantissa. For example:
\Mathics handles relative and absolute uncertainty in numerical quantities. The <em>precision</em> or relative accuracy, is set by adding a RawBackquote character ('`') and the number of digits of precision in the mantissa. For example:

>> 3.1416`3
= 3.14
Expand Down
2 changes: 1 addition & 1 deletion mathics/doc/latex/mathics.tex
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@

\title{
\includegraphics[height=0.1\linewidth]{logo-heptatom.pdf}
\includegraphics[height=0.08125\linewidth]{logo-text-nodrop.pdf}
\huge Mathics3
\\[.5em]
{\LARGE\color{subtitle}\textit{\textmd{A free, open-source alternative to Mathematica}}}
\par\textmd{\Large Mathics3 Core Version \MathicsCoreVersion}
Expand Down