Skip to content

Commit 775dedd

Browse files
Write down integral's two forms, and 1.4.0's unrecorded break (#848)
Syntax.md listed integral(expr, var) and stopped. The definite form integral(expr, var, from, to) is supported and covered by tests in three files, but a caller reading the syntax reference had no way to discover it -- and it is the form that replaced the three-argument one. It now lists both, and says why derivative takes an order while integral takes bounds. BREAKING-CHANGES.md begins at 2.0.0, so the change that introduced this -- PR #657 in 1.4.0, replacing the iteration count with a range -- has never had a home in it. 1.4.0 is what dotnet add package installs today, so it now has a section of its own. Documentation only.
1 parent 59db007 commit 775dedd

2 files changed

Lines changed: 36 additions & 2 deletions

File tree

‎BREAKING-CHANGES.md‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,6 +1528,34 @@ Not behavioural changes, listed so that a reader working through this file has t
15281528

15291529
---
15301530

1531+
## 1.4.0 — one change that was never written down
1532+
1533+
This file begins at 2.0.0, so a break introduced *by* 1.4.0 has had no home in it. One is worth
1534+
recording, because 1.4.0 is what a `dotnet add package` installs today and the change is silent
1535+
until a string is parsed.
1536+
1537+
### `integral` takes bounds, not an iteration count
1538+
1539+
| | 1.3.0 | 1.4.0 onwards |
1540+
|---|---|---|
1541+
| `integral(f, x, 1)` | accepted, read as `integral(f, x)` | `FunctionArgumentCountException` |
1542+
| `integral(f, x, a, b)` | — | the definite integral from `a` to `b` |
1543+
1544+
The third argument used to be a repetition count and is now the lower bound of a range, so three
1545+
arguments name neither form and are refused. `derivative(f, x, n)` is unaffected and still takes an
1546+
order, which is why the two functions read differently.
1547+
1548+
This was deliberate — PR [#657](https://github.com/asc-community/AngouriMath/pull/657), "change
1549+
integral node to support range instead of iterations" — and it is covered by a test. It simply went
1550+
out without a note. Both samples in this repository called `integral(f, x, 1)` and had been failing
1551+
against 1.4.0 since January without anyone seeing it, because they were pinned to 1.3.0; PR
1552+
[#846](https://github.com/asc-community/AngouriMath/pull/846) is what surfaced it.
1553+
1554+
**What to do.** `integral(f, x, 1)` becomes `integral(f, x)` — identical in meaning, since 1.3.0
1555+
turned the former into the latter anyway. For a repeated antiderivative, nest the calls.
1556+
1557+
---
1558+
15311559
## If one of these hurts
15321560

15331561
Open an issue at https://github.com/asc-community/AngouriMath/issues saying what you were relying

‎Sources/AngouriMath/Docs/Usage/Syntax.md‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,14 @@ any number of arguments and fold. `min` and `max` compare only where the argumen
108108
are otherwise left as written. `gcd` computes over integers and rationals — `gcd(1/2, 1/3)` is
109109
`1/6` — and leaves the polynomial case alone.
110110

111-
**Calculus** — `derivative(expr, var, order)`, `integral(expr, var)`, `limit(expr, var, dest)`,
112-
`limitleft(...)`, `limitright(...)`.
111+
**Calculus** — `derivative(expr, var, order)`, `integral(expr, var)`,
112+
`integral(expr, var, from, to)`, `limit(expr, var, dest)`, `limitleft(...)`, `limitright(...)`.
113+
114+
`derivative` takes an order and `integral` does not: `derivative(f, x, 2)` is the second
115+
derivative, while `integral`'s third and fourth arguments are the bounds of a definite integral,
116+
not a count. `integral(f, x, 2)` is therefore a parse error rather than the second antiderivative
117+
— three arguments name neither form. This is deliberate; the iteration count was replaced by the
118+
range in [#657](https://github.com/asc-community/AngouriMath/pull/657).
113119

114120
**Structural** — `piecewise(a provided p, b provided q)`, `lambda(param, body)`,
115121
`apply(f, arg, ...)`, `domain(expr, set)`.

0 commit comments

Comments
 (0)