Skip to content

Commit

Permalink
Upadte TI|BD input, and clean up more special chars / replacements.
Browse files Browse the repository at this point in the history
  • Loading branch information
adriweb committed Jul 29, 2024
1 parent e021fea commit 10930aa
Show file tree
Hide file tree
Showing 25 changed files with 380 additions and 97 deletions.
6 changes: 4 additions & 2 deletions tibd_downloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,8 @@ for (const page of pages) {
// Discard the sidebar content (ends at the token size thing), remove the empty end, resize titles, and do some cleanup.
articleHTML = articleHTML
.replace(/.*Token Size<\/a><\/strong><\/p>\n<p>(?:N\/A|\d bytes?(?: \(\w+\))?)<\/p>\n(?:<p><sub>\*OS [\d.]{1,10} or later<\/sub><\/p>\n)?<\/div>\n/s, '')
.replaceAll('re^θi', 'r𝑒^θ𝑖')
.replaceAll('θi', 'θ𝑖').replaceAll('re^θ𝑖', 'r𝑒^θ𝑖').replaceAll('1e^', '1𝑒^').replaceAll(/^e\^/gm, '𝑒^')
.replaceAll('e^(πi)', '𝑒^(π𝑖)').replaceAll('e^(180i)', '𝑒^(180𝑖)').replaceAll('a+bi', 'a+b𝑖')
.replaceAll('<a class="newpage" href="/"></a>', '')
.replaceAll('<a href="http://tibasicdev.wikidot.com/', '<a href="')
.replaceAll('<a href="/', '<a href="')
Expand All @@ -470,8 +471,9 @@ for (const page of pages) {
const markdown = turndownService.turndown(articleHTML)
.replaceAll(/____$/gm, '')
.replaceAll('\\(.md">', '(.md">') // fix up bad link stuff after "escaping" transformation above
.replaceAll('](e-exponent)', '](𝑒^(.md)')
.replaceAll('"e^(.md"', '"𝑒^(.md"')
.replaceAll('\\\\(.md)', '\\(.md)') // fix up bad link stuff after "escaping" transformation above
.replaceAll('](e-exponent)', '](𝑒^\\(.md)')
.replaceAll('[°](degree-symbol)', '[°](°.md)')
.replaceAll('<a href="degree-symbol">°</a>', '<a href="°.md">°</a>')
.replaceAll(/<a href="([^"]*)[<>]([^"]*)\.md">/gmi, '<a href="$1$2.md">')
Expand Down
27 changes: 27 additions & 0 deletions tokens/0x01.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,40 @@ It will also work when displaying a number by putting it on the last line of a p

Although <tt>►DMS</tt> is meant as a way to format angles in <tt><a href="Degree mode.md">Degree mode</a></tt>, it doesn't depend on the angle mode chosen, only on the number itself. Note that entering a number as _degree_°_minute_'_second_" will also work, in any mode, and it will not be converted to radians in <tt><a href="Radian mode.md">Radian mode</a></tt>.

## Rounding to Nearest Second

If you'd prefer to not have seconds with decimal places, you can round your answer to the nearest second with the following formula:

```ti-basic
round(Ans*3600,0)/3600►DMS
```

Or a slightly shorter version:

```ti-basic
round(Ans36,2)/36►DMS
```

**Tip:** If you find yourself needing this formula regularly, put it into a Y= graphing-function as:

```ti-basic
Y1=round(X36,2)/36
```

And then you can call it from your home screen via:

```ti-basic
Y1(123.45678►DMS
```

## Error Conditions

* **[ERR:SYNTAX](errors#syntax)** is thrown if the command is used somewhere other than the allowed display commands.
* **[ERR:DATA TYPE](errors#datatype)** is thrown if the value is complex, or if given a list or matrix as argument.

## Related Commands

* [° (Degree Symbol) Command](degree-symbol) (includes info on inserting degrees, minutes and seconds)
* <tt><a href="►Dec.md">►Dec</a></tt>
* <tt><a href="►Frac.md">►Frac</a></tt>
* <tt><a href="►Polar.md">►Polar</a></tt>
Expand Down
36 changes: 33 additions & 3 deletions tokens/0x04.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,45 @@ However, you can use [Equ►String(](equ-string) (outside a program) to get the

You can remove closing parentheses, braces, brackets, and quotes that are before a → command.

Here are a series of examples of using the → command. The first line of each example uses more bytes than necessary. The line following strips out the unnecessary characters and uses less bytes.

##### Real Variables

```ti-basic
:"Hello"→Str1
can be
:"Hello→Str1
1/(2*(3/4))→X
1/(2(3/4→X
```

##### Strings

```ti-basic
"Hello"→Str1
"Hello→Str1
```

##### Lists

```ti-basic
{1,2,3,2(X+1)}→L₁
{1,2,3,2(X+1→L₁
```

```ti-basic
5→L₁(1)
5→L₁(1
```

```ti-basic
{4,5,6}→ʟLISTX
{4,5,6→LISTX
```

Tip: You can remove the <tt>ʟ</tt> character when storing an entire list to a custom named list, but you must keep the <tt>ʟ</tt> character present when storing to a specific item, such as <tt>3→ʟLISTX(1</tt>

## Related Commands

* [DelVar](DelVar.md)
* [The ʟ Command](l) - used when referencing lists with a custom name

* * *

Expand Down
24 changes: 23 additions & 1 deletion tokens/0x0B.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

Normally, when the calculator is in radian mode, the trigonometric functions only return values calculated in radians. With the ° symbol you can have the angle evaluated as if in degree mode because it converts the angle into radians.

You can insert the degree symbol by pressing [2ND] [ANGLE] [ENTER].

One full rotation around a circle is 2π radians, which is equal to 360°. To convert an angle in radians to degrees you multiply by 180/π, and to convert from degrees to radians multiply by π/180.

In radian mode:
Expand All @@ -32,7 +34,6 @@ sin(45°)
.7071067812
```


In degree mode:

```ti-basic
Expand All @@ -42,6 +43,26 @@ sin(45°)
.7071067812 \\ There's no difference when in degrees
```

## Converting Degrees, Minutes & Seconds

The degree symbol also allows you to convert degrees, minutes and seconds into decimal degrees. For example:

```ti-basic
90°30'
90.5
90°30'09"
90.5025
```

The minute symbol is inserted by pressing [2ND] [ANGLE] [2]. The seconds symbol is inserted via [ALPHA] [+].

To convert back the other way (decimal to degrees-minutes-seconds) use the <tt><a href="►DMS.md">►DMS</a></tt> command, accessed via [2ND] [ANGLE] [4]:

```ti-basic
90.5025►DMS
90°30'09"
```

## Optimization

When you only call the trig function once in a program and want it calculated in degrees, instead of changing the mode you can just use ° to save one-byte (the newline from using the command Degree)
Expand All @@ -56,6 +77,7 @@ can be
## Related Commands

* <sup><a href="ʳ.md">ʳ</a></sup> (radian symbol)
* [►DMS](►DMS.md)

* * *

Expand Down
18 changes: 15 additions & 3 deletions tokens/0x12.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Returns a number, expression, list, or matrix rounded to `#decimals` ( 9).

## Description

round(_value_[,_#decimals_]) returns _value_ rounded to _#decimals_ decimal places. _#decimals_ must be < 10. The default value for _#decimals_ is 9. Also works on complex numbers, lists and matrices.
<tt>round(<em>value</em>[,<em>#decimals</em>])</tt> returns _value_ rounded to _#decimals_ decimal places. _#decimals_ must be < 10. The default value for _#decimals_ is 9. Also works on complex numbers, lists and matrices.

```ti-basic
round(5.45,0)
Expand All @@ -53,9 +53,21 @@ round([[1.8,3.5,120.3][3,‾1,0.2]],0)

## Advanced Uses

Sometimes, round-off error will cause the result of an expression to be slightly off of the correct integer value — for example, a result may be 5.0000000013 instead of 5. If the error is small enough, it will not even be visible if you recall the variable on the home screen. However, this is enough to cause a [ERR:DOMAIN](errors#domain) error with commands such as [sub(](sub\(.md) and [Output(](Output\(.md), which require their arguments to be integers.
Sometimes, round-off error will cause the result of an expression to be slightly off of the correct integer value — for example, a result may be 5.0000000013 instead of 5. If the error is small enough, it will not even be visible if you recall the variable on the home screen. However, this is enough to cause a <tt><a href="ERR:DOMAIN.md">ERR:DOMAIN</a></tt> error with commands such as <tt><a href="sub(.md">sub(</a></tt> and <tt><a href="Output(.md">Output(</a></tt>, which require their arguments to be integers.

The easiest way to fix this problem is by wrapping the different arguments in a round( instruction. For example, you may replace Output(X,1,">") with Output(round(X),1,">"). The [int(](int\(.md) command will not work here because the round-off error may be negative, such as 4.9999999986 instead of 5, in which case the number will be rounded down to 4.
The easiest way to fix this problem is by wrapping the different arguments in a <tt><a href="round.md">round</a>(</tt> instruction. For example, instead of:

```ti-basic
Output(X,1,">")
```

Try:

```ti-basic
Output(round(X,0),1,">")
```

The <tt><a href="int(.md">int(</a></tt> command will not work here because the round-off error may be negative, such as 4.9999999986 instead of 5, in which case the number will be rounded down to 4.

## Error Conditions

Expand Down
6 changes: 3 additions & 3 deletions tokens/0x14.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ However, the following way is faster and more memory-efficient while the program

## Related Commands

* <tt><a href="dim(.md">dim(</a></tt>
* <tt><a href="seq(.md">seq(</a></tt>
* <tt><sup><a href="transpose">T</a></sup></tt> (transpose)
* <tt><a href="dim(.md">dim(</a></tt> – for retrieving the size of a list
* <tt><a href="seq(.md">seq(</a></tt> – for creating a list based on a formula, or to create a subset of an existing list
* <tt><sup><a href="transpose">T</a></sup></tt> – to transpose a 2D matrix

* * *

Expand Down
45 changes: 32 additions & 13 deletions tokens/0x45.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,48 @@

## Description

The <tt>E</tt> symbol is used for entering numbers in scientific notation: it's short for *10^. This means that in many cases, its function is identical to that of the <tt><a href="10^(.md">10^(</a></tt> command (aside from the parenthesis). However, the exponent of <tt>E</tt> is limited to constant integer values ‾99 to 99.

## Examples
The <tt>E</tt> symbol is used in display by the calculator for large numbers, or when in <tt><a href="Sci.md">Sci</a></tt> (scientific) or <tt><a href="Eng.md">Eng</a></tt> (engineering) mode.

Explanation 1
```ti-basic
code 1
```
---
Explanation 2
```ti-basic
code 2
```
Unlike the exponent of <tt>E</tt>, the mantissa (a special term for the A in A*10^B, in scientific notation) isn't limited in variable type: it can be a constant, a real or complex variable or expression, a list, a matrix, or even omitted entirely (and then it will be assumed to equal 1). The reason for this versatility is simple: internally, only the exponent is taken to be an actual argument for this command. The rest of the calculation is done through implied multiplication.

## Error Conditions
5E3
………………5000
E‾5
……………….00001

## Advanced Uses

## Advanced Notes
<tt>E</tt>99 and -<tt>E</tt>99 are often used for negative and positive infinity because the TI-83 series of calculators doesn't have an infinity symbol. Commands that often need to use infinity include <tt><a href="solve(.md">solve(</a></tt>, <tt><a href="fnInt(.md">fnInt(</a></tt>, <tt><a href="normalcdf(.md">normalcdf(</a></tt> (and the other distributions), and many others. The error introduced in this way is usually irrelevant, because it's less than the minimum calculator precision, anyway: <tt>E</tt>99 is mindbogglingly huge.

## Optimization

Don't add the mantissa when it's 1:

1E5
should be
E5

In addition, <tt>E</tt>2 or <tt>E</tt>3 can be used as shorthand ways of writing 100 and 1000 respectively. This could be continued, in theory, for higher powers of 10, but those aren't necessary as often.

## Command Timings

<tt>E</tt> is much faster than using the <tt><a href="10^(.md">10^(</a></tt> command or typing out 10^. The drawback, of course, is that it's limited to constant values.

## Related Commands

* <tt><a href="^.md">^</a></tt>
* <tt><a href="10^(.md">10^(</a></tt>
* <tt><a href="𝑒^(.md">e^(</a></tt>

* * *

**Source**: parts of this page were written by the following TI|BD contributors: alexrudd, burr, DarkerLine, GoVegan, Myles_Zadok, simplethinker, Timothy Foster.

## History
| Calculator | OS Version | Description |
|------------|------------|-------------|
| <b>TI-82</b> | 1.0 | Added |

## Related Commands

4 changes: 2 additions & 2 deletions tokens/0x64.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ The output is differently expressed:

However, some commands are notably unaffected by angle mode, even though they involve angles, and this may cause confusion. This happens with the [SinReg](SinReg.md) command, which assumes that the calculator is in Radian mode even when it's not. As a result, the regression model it generates will graph incorrectly in Degree mode.

Also, complex numbers in polar form are an endless source of confusion. The angle( command, as well as the polar display format, are affected by angle mode. However, complex exponentials (see the [𝑒^(](𝑒^(.md) command), defined as $e^{i\theta}=\cos\theta+i\sin\theta$, are evaluated as though in Radian mode, regardless of the angle mode. This gives mysterious results like the following:
Also, complex numbers in polar form are an endless source of confusion. The angle( command, as well as the polar display format, are affected by angle mode. However, complex exponentials (see the [e^(](𝑒^\(.md) command), defined as $e^{i\theta}=\cos\theta+i\sin\theta$, are evaluated as though in Radian mode, regardless of the angle mode. This gives mysterious results like the following:

```ti-basic
Degree:r𝑒^θ𝑖
Done
𝑒^(πi)
1𝑒^(180i)
Ans=𝑒^(180i)
Ans=𝑒^(180𝑖)
0 (false)
```

Expand Down
4 changes: 2 additions & 2 deletions tokens/0x65.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ The output is differently expressed:

However, some commands are notably unaffected by angle mode, even though they involve angles, and this may cause confusion. This happens with the <tt><a href="SinReg.md">SinReg</a></tt> command, which assumes that the calculator is in <tt>Radian</tt> mode even when it's not. As a result, the regression model it generates will graph incorrectly in <tt>Degree</tt> mode.

Also, complex numbers in polar form are an endless source of confusion. The <tt>angle(</tt> command, as well as the polar display format, are affected by angle mode. However, complex exponentials (see the <tt><a href="𝑒^(.md">𝑒^(</a></tt> command), defined as $e^{i\theta}=\cos\theta+i\sin\theta$, are evaluated as though in Radian mode, regardless of the angle mode. This gives mysterious results like the following:
Also, complex numbers in polar form are an endless source of confusion. The <tt>angle(</tt> command, as well as the polar display format, are affected by angle mode. However, complex exponentials (see the <tt><a href="𝑒^(.md">e^(</a></tt> command), defined as $e^{i\theta}=\cos\theta+i\sin\theta$, are evaluated as though in Radian mode, regardless of the angle mode. This gives mysterious results like the following:

```ti-basic
Degree:r𝑒^θ𝑖
Done
𝑒^(πi)
1𝑒^(180i)
Ans=𝑒^(180i)
Ans=𝑒^(180𝑖)
0 (false)
```

Expand Down
Loading

0 comments on commit 10930aa

Please sign in to comment.