rm WeaveSupport
This commit is contained in:
@@ -6,14 +6,6 @@
|
||||
```{julia}
|
||||
#| echo: false
|
||||
using CalculusWithJulia
|
||||
using CalculusWithJulia.WeaveSupport
|
||||
|
||||
frontmatter = (
|
||||
title = "From calculator to computer",
|
||||
description = "Calculus with Julia: Replacing the calculator with a computer",
|
||||
tags = ["CalculusWithJulia", "precalc", "replacing the calculator with a computer"],
|
||||
);
|
||||
|
||||
nothing
|
||||
```
|
||||
|
||||
@@ -25,6 +17,7 @@ The following image is the calculator that Google presents upon searching for "c
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
#
|
||||
imgfile = "figures/calculator.png"
|
||||
caption = "Screenshot of a calculator provided by the Google search engine."
|
||||
ImageFile(:precalc, imgfile, caption)
|
||||
@@ -50,7 +43,7 @@ txt = """
|
||||
</iframe>
|
||||
</center>
|
||||
"""
|
||||
CalculusWithJulia.WeaveSupport.HTMLoutput(txt)
|
||||
HTMLoutput(txt)
|
||||
```
|
||||
|
||||
## Operations
|
||||
@@ -90,23 +83,19 @@ An expression like $6 - -3$, subtracting minus three from six, must be handled w
|
||||
6 - -3
|
||||
```
|
||||
|
||||
(If no space is included, the value "`--`" is parsed like a different, undefined, operation.)
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
warning(L"""
|
||||
(If no space is included, the value "`--`" is parsed like a different, invalid, operation.)
|
||||
|
||||
:::{.callout-warning}
|
||||
## Warning
|
||||
`Julia` only uses one symbol for minus, but web pages may not! Copying
|
||||
and pasting an expression with a minus sign can lead to hard to
|
||||
understand errors such as: `invalid character "−"`. There are several
|
||||
Unicode symbols that look similar to the ASCII minus sign, but are
|
||||
Unicode symbols that look similar to the ASCII minus sign, though
|
||||
different. These notes use a different character for the minus sign for
|
||||
the typeset math (e.g., $1 - \pi$) than for the code within cells
|
||||
(e.g. `1 - 2`). Thus, copying and pasting the typeset math may not work as expected.
|
||||
:::
|
||||
|
||||
""")
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
||||
@@ -369,14 +358,14 @@ In most cases. There are occasional (basically rare) spots where using `pi` by i
|
||||
### Numeric literals
|
||||
|
||||
|
||||
For some special cases, Julia implements *multiplication* without a multiplication symbol. This is when the value on the left is a number, as in `2pi`, which has an equivalent value to `2*pi`. *However* the two are not equivalent, in that multiplication with *numeric literals* does not have the same precedence as regular multiplication - it is higher. This has practical importance when used in division or powers. For instance, these two are **not** the same:
|
||||
For some special cases, Julia parses *multiplication* without a multiplication symbol. This is when the value on the left is a number, as in `2pi`, which has an equivalent value to `2*pi`. *However* the two are not equivalent, in that multiplication with *numeric literals* does not have the same precedence as regular multiplication - it is higher. This has practical importance when used in division or powers. For instance, these two are **not** the same:
|
||||
|
||||
|
||||
```{julia}
|
||||
1/2pi, 1/2*pi
|
||||
```
|
||||
|
||||
Why? Because the first `2pi` is performed before division, as multiplication with numeric literals has higher precedence than regular multiplication, which is at the same level as division.
|
||||
Why? Because the first `2pi` is performed before division, as multiplication with numeric literals has higher precedence than regular multiplication, which is at the same level as division.
|
||||
|
||||
|
||||
To confuse things even more, consider
|
||||
@@ -436,7 +425,8 @@ julia = [
|
||||
"`factorial`"
|
||||
]
|
||||
|
||||
CalculusWithJulia.WeaveSupport.table(DataFrame(Calculator=calc, Julia=julia))
|
||||
d = DataFrame(Calculator=calc, Julia=julia)
|
||||
Table(d)
|
||||
```
|
||||
|
||||
Using a function is very straightforward. A function is called using parentheses, in a manner visually similar to how a function is called mathematically. So if we consider the `sqrt` function, we have:
|
||||
@@ -1068,4 +1058,3 @@ choices = [
|
||||
answ=1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user