Skip to content

Commit af27c0b

Browse files
author
livecodesam
committed
[Bugfix-21741] Add note to docs about evaluating scientific notation
1 parent de4421e commit af27c0b

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

docs/dictionary/operator/equals.lcdoc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ Use the <=> (equality) <operator> to find out whether two <numeric>
3636
<expression|expressions> yield the same number or whether two
3737
<string|strings> are equivalent.
3838

39+
>*Note:* A string in the form "xEy", where x is a number and y is an
40+
>integer will be treated as a number in <scientific notation>. This
41+
>means that such a string is evaluated as x * 10^y. For example:
42+
43+
put "5e2" = "500" -- returns true
44+
3945
When comparing strings, the <=> <operator> compares the two
4046
<value|values> <character> by <character>. If the <caseSensitive>
4147
<property> is true, the comparison between two <string|strings> treats
@@ -75,7 +81,8 @@ Previously, comparing two arrays would have converted both arrays into
7581
the empty string, and always returned true.
7682

7783
References: property (glossary), operator (glossary),
78-
case-sensitive (glossary), value (glossary), string (glossary),
84+
case-sensitive (glossary), scientific notation (glossary),
85+
value (glossary), string (glossary),
7986
expression (glossary), character (keyword), numeric (keyword),
8087
&lt;&gt; (operator), contains (operator), caseSensitive (property)
8188

docs/glossary/s/scientific-notation.lcdoc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@ A way of <format|formatting> numbers where the number is represented as
99
a <value> between one and ten, multiplied by the appropriate power of
1010
ten.
1111

12-
References: format (glossary), value (glossary)
12+
>*Note:* Whenever a string takes the form xEy in LiveCode, where x is a
13+
> number and y is in an <integer>, it is interpreted as a number in
14+
> scientific notation. This means that such a string is evaluated as
15+
> x*10^y. For example:
16+
17+
18+
19+
References: format (glossary), integer (glossary), value (glossary)
1320

1421
Tags: math
1522

0 commit comments

Comments
 (0)