Debian Codegraph @

fon/manual_formulas.cpp

raw symbols SCIP
1 /* manual_formulas.cpp
2 *
3 * Copyright (C) 1992-2025 Paul Boersma
4 *
5 * This code is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or (at
8 * your option) any later version.
9 *
10 * This code is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this work. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 #include "ManPagesM.h"cxx . . $ `<file>/sys/ManPagesM.h`/
20
21 void manual_formulas_initcxx . . $ manual_formulas_init(e57bd08652fa63a5). (ManPagescxx . . $ ManPages# me);
22 void manual_formulas_initcxx . . $ manual_formulas_init(e57bd08652fa63a5). (ManPagescxx . . $ ManPages# me) {
23
24 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Calculator", U"ppgb", 20210228)
25 INTROcxx . . $ `sys/ManPagesM.h:35:9`! (U"A window that allows you to calculate all kinds of simple or complicated mathematical and string expressions. "
26 "To show the calculator, type @@Keyboard shortcuts|Command-U@ or choose the @@Calculator...@ command. "
27 "The result will appear in the Info window.")
28 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"See the @Formulas tutorial for all the things that you can calculate with this command.")
29 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
30
31 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Calculator...", U"ppgb", 20050822)
32 INTROcxx . . $ `sys/ManPagesM.h:35:9`! (U"A command in the @Goodies submenu of the @@Praat menu@ of the @@Objects window@. Shortcut: @@Keyboard shortcuts|Command-U@. "
33 "Choosing this command brings up Praat's @calculator.")
34 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
35
36 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"undefined", U"ppgb", 20170910)
37 INTROcxx . . $ `sys/ManPagesM.h:35:9`! (U"When you give a query command for a numeric value, Praat sometimes writes the numeric value ##--undefined--# "
38 "into the @@Info window@ (two hyphens at both sides of the word). This happens if the value you ask for is not defined, "
39 "as in the following examples:")
40 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"\\bu You select a Sound with a finishing time of 1.0 seconds and ask for the minimum point in the wave form "
41 "between 1.5 and 2.0 seconds (with the query command ##Get minimum...#).")
42 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"\\bu You ask for a pitch value in a voiceless part of the sound (select a #Pitch, "
43 "then choose ##Get value at time...#).")
44 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"\\bu You type into the @Calculator the following formula: 10\\^ 400.")
45 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Usage in a script")
46 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"In a Praat script, this value is simply represented as \"undefined\". You use it to test whether "
47 "a query command returned a valid number:")
48 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"selectObject: \"Pitch hallo\"")
49 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"meanPitch = Get mean: 0.1, 0.2, \"Hertz\", \"Parabolic\"")
50 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"if meanPitch = undefined")
51 CODE1cxx . . $ `sys/ManPagesM.h:51:9`! (U"# Take some exceptional action.")
52 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"else")
53 CODE1cxx . . $ `sys/ManPagesM.h:51:9`! (U"# Take the normal action.")
54 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"endif")
55 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Details for hackers")
56 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"In text files, this value is written as ##--undefined--#. "
57 "In binary files, it is written as a big-endian IEEE positive infinity. "
58 "In memory, it is usually a specific \"not-a-number\" (NaN), namely the result of dividing 0 by 0, "
59 "although other NaNs, and also infinities, will equally be reported as --undefined--.")
60 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
61
62 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Formulas", U"ppgb", 20170916)
63 INTROcxx . . $ `sys/ManPagesM.h:35:9`! (U"You can use numeric expressions and string (text) expressions in many places in Praat:")
64 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"\\bu in the @calculator in Praat’s @Goodies submenu;")
65 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"\\bu in the numeric fields of most settings windows;")
66 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"\\bu in a @@Praat script@.")
67 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"For some types of objects (mainly Sound and Matrix), you can also apply formulas to all their contents at the same time:")
68 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"\\bu when you create a Sound or a Matrix from the @@New menu@;")
69 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"\\bu when you choose @@Formula...@ from the @Modify menu for a selected object.")
70 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"You can read this tutorial sequentially with the help of the “##< 1#” and “##1 >#” buttons.")
71 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"1. @@Formulas 1. My first formulas|My first formulas@")
72 LIST_ITEM1cxx . . $ `sys/ManPagesM.h:39:9`! (U"1.1. @@Formulas 1.1. Formulas in the calculator|Formulas in the calculator@")
73 LIST_ITEM1cxx . . $ `sys/ManPagesM.h:39:9`! (U"1.2. @@Formulas 1.2. Numeric expressions|Numeric expressions@")
74 LIST_ITEM1cxx . . $ `sys/ManPagesM.h:39:9`! (U"1.3. @@Formulas 1.3. String expressions|String expressions@")
75 LIST_ITEM1cxx . . $ `sys/ManPagesM.h:39:9`! (U"1.4. @@Formulas 1.4. Array expressions|Array expressions@")
76 LIST_ITEM1cxx . . $ `sys/ManPagesM.h:39:9`! (U"1.5. @@Formulas 1.5. Formulas in settings windows|Formulas in settings windows@")
77 LIST_ITEM1cxx . . $ `sys/ManPagesM.h:39:9`! (U"1.6. @@Formulas 1.6. Formulas for creation|Formulas for creation@")
78 LIST_ITEM1cxx . . $ `sys/ManPagesM.h:39:9`! (U"1.7. @@Formulas 1.7. Formulas for modification|Formulas for modification@")
79 LIST_ITEM1cxx . . $ `sys/ManPagesM.h:39:9`! (U"1.8. @@Formulas 1.8. Formulas in scripts|Formulas in scripts@")
80 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"2. @@Formulas 2. Representations|Representations@")
81 LIST_ITEM1cxx . . $ `sys/ManPagesM.h:39:9`! (U"2.1. @@Formulas 2.1. Representation of numbers|Representation of numbers@")
82 LIST_ITEM1cxx . . $ `sys/ManPagesM.h:39:9`! (U"2.2. @@Formulas 2.2. Representation of strings|Representation of strings@")
83 LIST_ITEM1cxx . . $ `sys/ManPagesM.h:39:9`! (U"2.3. @@Formulas 2.3. Representation of arrays|Representation of arrays@")
84 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"3. @@Formulas 3. Operators|Operators@ (`+`, `-`, `*`, `/`, `^`)")
85 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"4. @@Formulas 4. Constants|Constants@ (`pi`, `e`, `undefined`)")
86 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"5. @@Formulas 5. Mathematical functions|Mathematical functions@")
87 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"6. @@Formulas 6. String functions|String functions@")
88 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"7. @@Formulas 7. Control structures|Control structures@ (`if then else fi`, semicolon)")
89 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"8. @@Formulas 8. Attributes of objects|Attributes of objects@")
90 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"9. @@Formulas 9. Data in objects|Data in objects@")
91 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
92
93 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Formulas 1. My first formulas", U"ppgb", 20170916)
94 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"1.1. @@Formulas 1.1. Formulas in the calculator|Formulas in the calculator@")
95 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"1.2. @@Formulas 1.2. Numeric expressions|Numeric expressions@")
96 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"1.3. @@Formulas 1.3. String expressions|String expressions@")
97 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"1.4. @@Formulas 1.4. Array expressions|Array expressions@")
98 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"1.5. @@Formulas 1.5. Formulas in settings windows|Formulas in settings windows@")
99 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"1.6. @@Formulas 1.6. Formulas for creation|Formulas for creation@")
100 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"1.7. @@Formulas 1.7. Formulas for modification|Formulas for modification@")
101 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"1.8. @@Formulas 1.8. Formulas in scripts|Formulas in scripts@")
102 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
103
104 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Formulas 1.1. Formulas in the calculator", U"ppgb", 20170916)
105 INTROcxx . . $ `sys/ManPagesM.h:35:9`! (U"To use the Praat @calculator, go to the @@Praat menu@ "
106 "and choose @@Calculator...@ from the @Goodies submenu. Or simply type @@Keyboard shortcuts|Command-U@ anywhere in Praat.")
107 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Calculating numbers")
108 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"You can do arithmetic computations. Type the formula")
109 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"8*17")
110 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"and click OK. The Info window will pop up and show the result:")
111 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"136")
112 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Calculating strings")
113 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"You can also do text computations. Type the formula")
114 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"\"see\" + \"king\"")
115 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"and click OK. The Info window will show the result:")
116 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"seeking")
117 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Calculating arrays")
118 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"You can perform computations on vectors (arrays of numbers). Type the formula")
119 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"{ 11, 13, 17 } + 0.5")
120 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"and click OK. The Info window will show the result:")
121 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"11.5")
122 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"13.5")
123 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"17.5")
124 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
125
126 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Formulas 1.2. Numeric expressions", U"ppgb", 20170916)
127 INTROcxx . . $ `sys/ManPagesM.h:35:9`! (U"All the formulas whose outcome is a number are called numeric expressions. "
128 "For the following examples, all the outcomes can be checked with the @calculator.")
129 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Examples with numbers")
130 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Some numeric expressions involve numbers only:")
131 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##8*17")
132 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"computes a multiplication. Outcome: 136.")
133 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##2\\^ 10")
134 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"computes the tenth power of 2. Outcome: 1024.")
135 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##sqrt (2) / 2")
136 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"computes the square root of 2, and divides the result by 2. Outcome: 0.7071067811865476.")
137 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##sin (1/4 * pi)")
138 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"computes the sine of %\\pi/4. Outcome: 0.7071067811865476 (again).")
139 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Examples with strings")
140 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Some numeric expressions compute numeric properties of strings:")
141 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##length (\"internationalization\")")
142 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"computes the length of the string \"internationalization\". Outcome: 20.")
143 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##index (\"internationalization\", \"ation\")")
144 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"computes the location of the first occurrence of the string \"ation\" in the string \"internationalization\". Outcome: 7, "
145 "because the first letter of \"ation\" lines up with the seventh letter of \"internationalization\". "
146 "If the substring does not occur, the outcome is 0.")
147 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Examples with arrays")
148 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Some numeric expressions compute numeric properties of numeric vectors:")
149 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##size ({ 40, 70, 60, 50 })")
150 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"computes the length of the vector { 40, 70, 60, 50 }, i.e. the number of its elements. Outcome: 4.")
151 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##mean ({ 40, 70, 60, 50 })")
152 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"computes the mean of the four numbers 40, 70, 60 and 50. Outcome: 55.")
153 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
154
155 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Formulas 1.3. String expressions", U"ppgb", 20170916)
156 INTROcxx . . $ `sys/ManPagesM.h:35:9`! (U"All the formulas whose outcome is a text are called string expressions. "
157 "A %string is programming jargon for a text; think of a text as a “string” of characters (letters).")
158 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Again, the outcomes of the following examples can be checked with the @calculator.")
159 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##\"see\" + \"king\"")
160 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"concatenates two strings. Outcome: seeking.")
161 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##left\\$ (\"internationalization\", 6)")
162 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"computes the leftmost six letters of the string; the dollar sign is used for all functions whose result is a string. Outcome: intern.")
163 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##mid\\$ (\"internationalization\", 6, 8)")
164 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"computes the 8-letter substring that starts at the sixth letter of \"internationalization\". Outcome: national.")
165 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##date\\$ ( )")
166 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"computes the current date and time. Outcome at the time I am writing this: Mon Dec 2 02:23:45 2002.")
167 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
168
169 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Formulas 1.4. Array expressions", U"ppgb", 20170916)
170 INTROcxx . . $ `sys/ManPagesM.h:35:9`! (U"A numeric vector expression is an expression whose value is a numeric vector.")
171 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"You can check the outcomes of the following examples with the @calculator.")
172 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##{ 11, 13, 17 } + 0.5")
173 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"adds 0.5 to each element of a vector with three elements, giving a new vector with three elements. "
174 "Praat writes the outcome to the Info window as three lines, containing the numbers 11.5, 13.5 and 17.5:")
175 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"11.5")
176 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"13.5")
177 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"17.5")
178 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"@`zero#` (5)")
179 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"creates a vector with 5 zeroes. Praat writes them on five lines:")
180 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"0")
181 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"0")
182 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"0")
183 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"0")
184 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"0")
185 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"@`repeat#` ({ 1, 5 }, 6)")
186 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"creates a vector with 12 elements, in which the sequence { 1, 5 } is repeated 6 times. Outcome:")
187 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"1")
188 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"5")
189 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"1")
190 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"5")
191 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"1")
192 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"5")
193 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"1")
194 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"5")
195 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"1")
196 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"5")
197 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"1")
198 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"5")
199 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
200
201 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Formulas 1.5. Formulas in settings windows", U"ppgb", 20170916)
202 INTROcxx . . $ `sys/ManPagesM.h:35:9`! (U"Into numeric fields in settings windows you usually simply type a number. "
203 "However, you can use any numeric expression instead.")
204 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"For instance, suppose you want to create a Sound that contains exactly 10000 samples. "
205 "If the sampling frequency is 44100 Hz, the duration will be 10000/44100 seconds. "
206 "You can create such a Sound by choosing @@Create Sound from formula...@ from the @@New menu@, "
207 "then typing")
208 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"10000/44100")
209 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"into the ##End time# field.")
210 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Into text fields in settings windows, you can only type text directly; there is no way "
211 "to use string expressions (except if you use scripts; see @@Formulas 1.8. Formulas in scripts@).")
212 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Into numeric vector fields in settings windows, you can type any numeric vector (array) expression.")
213 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
214
215 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Formulas 1.6. Formulas for creation", U"ppgb", 20110128)
216 INTROcxx . . $ `sys/ManPagesM.h:35:9`! (U"With some commands in the @@New menu@, you can supply a formula that Praat will apply to all elements of the new object.")
217 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Creating a Sound from a formula")
218 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Choose @@Create Sound from formula...@ and type the following into the #%Formula field:")
219 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"1/2 * sin (2 * pi * 377 * x)")
220 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"When you click #OK, a new @Sound object will appear in the list. "
221 "After you click ##View & Edit# and zoom in a couple of times, you will see that the sound is a sine wave "
222 "with a frequency of 377 hertz (cycles per second). This worked because the $x in the formula represents the time, "
223 "i.e. the formula was applied to every sample separately, with a different value of $x for each sample.")
224 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Creating a Matrix from a formula")
225 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Choose @@Create simple Matrix...@ and type the following into the #%Formula field:")
226 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"8")
227 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"When you click OK, a new @Matrix object will appear in the list. When you click #Info, "
228 "you will see that it is a matrix with 10 rows and 10 columns, and that all the 100 cells contain the value 8 "
229 "(you can see this because both the minimum and the maximum are reported as being 8).")
230 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"A more interesting example is the formula")
231 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"row * col")
232 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"For the resulting Matrix, "
233 "choose @@Matrix: Paint cells...|Paint cells...@ and click #OK. The Picture window will show a 10\\xx10 "
234 "matrix whose elements are the product of the row and column numbers, i.e., they have values between "
235 "1 and 100. Beside $row and $col, you can use $x for the distance along the horizontal axis and $y for the "
236 "distance along the vertical axis; see the following page for examples.")
237 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
238
239 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Formulas 1.7. Formulas for modification", U"ppgb", 20170916)
240 INTROcxx . . $ `sys/ManPagesM.h:35:9`! (U"Analogously to the formulas that you can use for creating new objects (see the previous page), "
241 "you can use formulas for modifying existing objects. You do this with the command ##Formula...# that you "
242 "can find in the @Modify menu when you select an object.")
243 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Modifying a Sound with a formula")
244 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Record a sound with your microphone and talk very lowly. If you don't know how to record a sound in Praat, "
245 "consult the @Intro. Once the Sound object is in the list, click #Play. The result will sound very soft. "
246 "Then choose ##Formula...# from the Modify menu and type")
247 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"self * 3")
248 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Click OK, then click #Play again. The sound is much louder now. You have multiplied the amplitude of every sample "
249 "in the sound with a factor of 3.")
250 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Replacing the contents of a Sound with a formula")
251 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"If you don’t use `self` in your formula, the formula does not refer to the existing contents of the Sound. Hence, the formula ")
252 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"1/2 * sin (2 * pi * 377 * x)")
253 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"will simply replace your recorded speech with a 377-Hz sine wave.")
254 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Modifying a Matrix with a formula")
255 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Many objects can be thought of as matrices: "
256 "they consist of a number of rows and columns with data in every cell:")
257 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"@Sound: one row; columns represent samples.")
258 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"@Spectrum: two rows (first row is real part, second row is imaginary part); "
259 "columns represent frequencies.")
260 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"@Spectrogram, @Cochleagram: rows represent frequencies; columns represent times.")
261 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"@Excitation: one row; columns represent frequency bands.")
262 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"@Harmonicity: one row; columns represent time frames.")
263 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The formula is performed on every column of every row. The formula")
264 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"self^2")
265 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"will square all matrix elements.")
266 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The formula first works on the first row, and in that row from the first column on; "
267 "this can work recursively. The formula")
268 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"self + self [row, col - 1]")
269 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"integrates each row.")
270 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Referring to the current position in the object")
271 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"You can refer to the current position in a Matrix (or Sound, etc.) by index or by %x and %y values:")
272 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`row`")
273 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the current row")
274 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`col`")
275 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the current column")
276 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`x`")
277 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the %x value associated with the current column:")
278 LIST_ITEM2cxx . . $ `sys/ManPagesM.h:40:9`! (U"for a Sound, Spectrogram, Cochleagram, or Harmonicity: time, as in the 377-Hz sine wave example above")
279 LIST_ITEM2cxx . . $ `sys/ManPagesM.h:40:9`! (U"for a Spectrum: frequency (Hz)")
280 LIST_ITEM2cxx . . $ `sys/ManPagesM.h:40:9`! (U"for an Excitation: frequency (Bark)")
281 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`y`")
282 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the %y value associated with the current row:")
283 LIST_ITEM2cxx . . $ `sys/ManPagesM.h:40:9`! (U"for a Spectrogram: frequency (Hz)")
284 LIST_ITEM2cxx . . $ `sys/ManPagesM.h:40:9`! (U"for a Cochleagram: frequency (Bark)")
285 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Referring to the contents of the object itself")
286 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"You can refer to values in the current Matrix (or Sound, etc.) by index.")
287 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`self`")
288 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"refers to the value in the current Matrix at the current row and column, or to the value in the current Sound at the current sample.")
289 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`self` [%`column-expression`]")
290 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"refers to the value in the current Sound (or Intensity etc.) at the current sample (or frame). "
291 "The %`column-expression` is rounded to the nearest integer. "
292 "If the index is out of range (less than 1 or greater than %n__%x_), the expression evaluates as 0.")
293 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"#Example. An integrator is")
294 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U" self [col - 1] + self * dx")
295 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`self` [%`row-expression`, %`column-expression`]")
296 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"refers to the value in the current Matrix (or Spectrogram etc.) at the specified row and column. "
297 "The expressions are rounded to the nearest integers.")
298 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"You can refer to values in the current Matrix (or Spectrogram, etc.) by %x and %y position:")
299 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`self` (%`x-expression`, %`y-expression`)")
300 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the expressions are linearly interpolated between the four nearest matrix points.")
301 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"You can refer to values in the current Sound (or Intensity etc.) by %x position:")
302 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`self` (%`x-expression`)")
303 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the expression is linearly interpolated between the two nearest samples (or frames).")
304 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
305
306 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Formulas 1.8. Formulas in scripts", U"ppgb", 20170916)
307 INTROcxx . . $ `sys/ManPagesM.h:35:9`! (U"In scripts, you can assign numeric expressions to numeric variables, "
308 "string expressions to string variables, and array expressions to array variables. "
309 "You can also use numeric, string and array variables in expressions.")
310 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Example: report a square")
311 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Choose @@New Praat script@ from the @@Praat menu@. A script editor window will become visible. "
312 "Type the following lines into that window:")
313 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"x = 99")
314 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"x2 = x * x")
315 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"writeInfoLine: “The square of ”, x, “ is ”, x2, “.”")
316 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"This is an example of a simple @@Praat script@; "
317 "it assigns the results of the numeric formulas `99` and `x * x` "
318 "to the numeric variables %`x` and %`x2`. Note that the formula `x * x` itself refers to the variable %`x`. "
319 "To run (execute) this script, type @@Keyboard shortcuts|Command-R@ or choose #Run from the Run menu. "
320 "Praat will then write the following text into the Info window:")
321 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"The square of 99 is 9801.")
322 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"For more information on scripts, see the @Scripting tutorial.")
323 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Example: rename the city of Washington")
324 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Type the following text into the script editor window:")
325 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"current$ = “Bush”")
326 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"previous$ = “Clinton”")
327 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"famous$ = “Lincoln”")
328 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"newCapital$ = current$ + mid$ (famous$, 2, 3) + right$ (previous$, 3)")
329 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"writeInfoLine: “The new capital will be ”, newCapital$, “.”")
330 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"This script assigns the results of four string expressions to the four string variables `current$`, "
331 "`previous$`, `famous$`, and `newCapital$`. The dollar sign is the notation for a string variable or "
332 "for a function whose result is a string (like `left$`). Note that the formula in the fourth line refers to three existing "
333 "variables.")
334 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"To see what the new name of the capital will be, choose #Run.")
335 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Example: report five squares")
336 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Type the following script:")
337 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"x# = { 1, 2, 3, 4, 5 }")
338 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"x2# = x# * x#")
339 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"writeInfoLine: “The squares of ”, x#, “ are ”, x2#, “.”")
340 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Praat will then write the following text into the Info window:")
341 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"The squares of 1 2 3 4 5 are 1 4 9 16 25.")
342 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Example: numeric expressions in settings in scripts")
343 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"As in real settings windows, you can use numeric expressions in all numeric fields. "
344 "The example of two pages back becomes:")
345 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"Create Sound from formula: “sine”, 1, 0, 10000 / 44100, 44100, ~ 0.9 * sin (2*pi*377*x)")
346 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Example: string expressions in settings in scripts")
347 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"As in real settings windows, you can use string expressions in all text fields:")
348 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"soundName$ = “hello”")
349 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"Read from file: soundName$ + “.wav”")
350 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Example: numeric expressions in creation in scripts")
351 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Suppose you want to generate a sine wave whose frequency is held in a variable. This is the way:")
352 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"frequency = 377")
353 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"Create Sound from formula: “sine”, 1, 0.0, 1.0, 44100, ~ 0.9 * sin (2*pi*frequency*x)")
354 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"In this example, Praat will protest if `x` is a variable as well (%`x`), because that would be ambiguous "
355 "with the `x` that refers to the time in the sound (see @@Formulas 1.7. Formulas for modification@).")
356 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
357
358 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Formulas 2. Representations", U"ppgb", 20170916)
359 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"2.1. @@Formulas 2.1. Representation of numbers|Representation of numbers@")
360 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"2.2. @@Formulas 2.2. Representation of strings|Representation of strings@")
361 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"2.3. @@Formulas 2.3. Representation of arrays|Representation of arrays@")
362 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
363
364 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Formulas 2.1. Representation of numbers", U"ppgb", 20170916)
365 INTROcxx . . $ `sys/ManPagesM.h:35:9`! (U"Formulas can work with integer numbers as well as with real numbers.")
366 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Real numbers")
367 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"You can type many real numbers by using a decimal notation, for instance 3.14159, 299792.5, or -0.000123456789. "
368 "For very large or small numbers, you can use the %e-notation: 6.022\\.c10^^23^ is typed as `6.022e23` or `6.022e+23`, "
369 "and -1.6021917\\.c10^^-19^ is typed as `-1.6021917e-19`. You can use also use the percent notation: 0.157 "
370 "can be typed as `15.7%`.")
371 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"There are some limitations as to the values that real numbers can have in Praat. "
372 "The numbers must lie between -10^^308^ and +10^^308^. If you type")
373 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"1e200 * 1e100")
374 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"the outcome will be")
375 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"1e+300")
376 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"but if you type")
377 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"1e300 * 1e100")
378 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"the outcome will be")
379 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"--undefined--")
380 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Another limitation is that the smallest non-zero numbers lie near -10^^-308^ and +10^^-308^. If you type")
381 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"1e-200 / 1e100")
382 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"the outcome will be")
383 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"1e-300")
384 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"but if you type")
385 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"1e-300 / 1e100")
386 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"the outcome will be")
387 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"0")
388 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Finally, the precision of real numbers is limited by the number of bits that every real number is stored with "
389 "in the computer, namely 64. For instance, if you type")
390 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"pi")
391 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"the outcome will be")
392 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"3.141592653589793")
393 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"because only 16 digits of precision are stored. This can lead to unexpected results caused by rounding. "
394 "For instance, the formula")
395 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"0.34999999999999999 - 0.35")
396 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"will result in")
397 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"0")
398 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"rather than the correct value of 1e-17. This is because the numbers 0.34999999999999999 and 0.35 cannot "
399 "be distinguished in the computer's memory. If you simply type")
400 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"0.34999999999999999")
401 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"the outcome will be")
402 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"0.35")
403 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"(as in this example, the calculator will always come up with the minimum number of digits needed to represent the number unambiguously).")
404 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Another example of inaccuracy is the formula")
405 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"1 / 7 / 59 * 413")
406 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Because of rounding errors, the result will be")
407 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"0.9999999999999999")
408 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Integer numbers")
409 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Formulas can work with integer (whole) numbers between -1,000,000,000,000,000 and +1,000,000,000,000,000. "
410 "You type them without commas and without the plus sign: 337, -848947328345289.")
411 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"You %can work with larger numbers than that (up to 10^^308^), but there will again be rounding errors. "
412 "For instance, the formula")
413 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"1000000000000000 + 1")
414 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"correctly yields")
415 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"1000000000000001")
416 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"but the formula")
417 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"10000000000000000 + 1")
418 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"yields an incorrect outcome:")
419 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"1e16")
420 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
421
422 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Formulas 2.2. Representation of strings", U"ppgb", 20021203)
423 INTROcxx . . $ `sys/ManPagesM.h:35:9`! (U"Formulas can work with strings that are put between two double quotes, "
424 "as in “goodbye” or “how are you doing?”.")
425 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"If a string has to contain a double quote, "
426 "you have to type it twice. For instance, if you type")
427 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"\"I asked: \"\"how are you doing?\"\"\"")
428 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"into the calculator, the outcome will be")
429 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"I asked: \"how are you doing?\"")
430 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
431
432 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Formulas 2.3. Representation of arrays", U"ppgb", 20170916)
433 INTROcxx . . $ `sys/ManPagesM.h:35:9`! (U"Formulas can work with vectors that are put between opening and closing braces, "
434 "as in { 11, 17, 13.5 }. If you type this into the calculator, the outcome will be")
435 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"11")
436 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"17")
437 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"13.5")
438 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
439
440 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Formulas 3. Operators", U"ppgb", 20230124)
441 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"In formulas you can use the numerical and logical operators that are described on this page. "
442 "The order of evaluation of the operators is the order that is most usual in programming languages. "
443 "To force a different order, you use parentheses.")
444 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The operators with the highest precedence are #negation (-) and #exponentation (\\^ ):")
445 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"--6 \\-> 6")
446 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"2^6 \\-> 64")
447 /*@praat
448 # Tests for the manual page "Operators".
449
450 assert --6 = 6
451 assert 2^6 = 64
452 @*/
453 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Sequences of negation and exponentiation are evaluated from right to left:")
454 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"2^-6 \\-> 0.015625") //@praat assert 2^-6 = 0.015625
455 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"-(1+1)^6 \\-> -64") //@praat assert -(1+1)^6 = -64
456 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"4^3^2 \\-> 4^9 \\-> 262144") //@praat assert 4^3^2 = 262144
457 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Note that changing the spacing does not change the meaning:")
458 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"4^3 ^ 2 \\-> 262144") //@praat assert 4^3 ^ 2 = 262144
459 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"To change the order of evaluation, you have to use parentheses:")
460 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"(4 ^ 3) ^ 2 \\-> 4096") //@praat assert (4 ^ 3) ^ 2 = 4096
461 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The following construction is not allowed because of an ambiguity between a negative number "
462 "and negation of a positive number:")
463 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"-2^6 \\-> ?")
464 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Instead, you use any of the following:")
465 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"(-2)^6 \\-> 64") //@praat assert (-2)^6 = 64
466 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"-(2^6) \\-> -64") //@praat assert -(2^6) = -64
467 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"-(2)^6 \\-> -64") //@praat assert -(2)^6 = -64
468 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The operators with the next highest precedence are #multiplication (*) and #division (/). They are evaluated "
469 "from left to right:")
470 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"1/4*5 \\-> 1.25 (from left to right)")
471 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"1 / 4*5 \\-> 1.25 (spacing does not help)")
472 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"1 / (4*5) \\-> 0.05 (use parentheses to change the order)")
473 /*@praat
474 assert 1/4*5 = 1.25
475 assert 1 / 4*5 = 1.25
476 assert 1 / (4*5) = 0.05
477 @*/
478 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"3 * 2 ^ 4 \\-> 48 (exponentiation before multiplication)")
479 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"3*2 ^ 4 \\-> 48 (this spacing does not matter and is misleading)")
480 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"(3 * 2) ^ 4 \\-> 1296 (use parentheses to change the order)")
481 /*@praat
482 assert 3 * 2 ^ 4 = 48
483 assert 3*2 ^ 4 = 48
484 assert (3 * 2) ^ 4 = 1296
485 @*/
486 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"##Integer division# operators (#div and #mod) have the same precedence as * and /, "
487 "and are likewise evaluated from left to right:")
488 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"54 div 5 \\-> 10 (division rounded down)") //@praat assert 54 div 5 = 10
489 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"54 mod 5 \\-> 4 (the remainder)") //@praat assert 54 mod 5 = 4
490 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"54.3 div 5.1 \\-> 10 (works for real numbers as well)") //@praat assert 54.3 div 5.1 = 10
491 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"54.3 mod 5.1 \\-> 3.3 (the remainder)") //@praat assert abs ((54.3 mod 5.1) - 3.3) < 1e-14
492 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"-54 div 5 \\-> -11 (division rounded down; negation before division)") //@praat assert -54 div 5 = -11
493 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"-54 mod 5 \\-> 1 (the remainder)") //@praat assert -54 mod 5 = 1
494 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"-(54 div 5) \\-> -10 (use parentheses to change the order)") //@praat assert -(54 div 5) = -10
495 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"-(54 mod 5) \\-> -4") //@praat assert -(54 mod 5) = -4
496 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"3 * 18 div 5 \\-> 10 (from left to right)") //@praat assert 3 * 18 div 5 = 10
497 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"3 * (18 div 5) \\-> 9") //@praat assert 3 * (18 div 5) = 9
498 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"3 * 18 mod 5 \\-> 4") //@praat assert 3 * 18 mod 5 = 4
499 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"3 * (18 mod 5) \\-> 9") //@praat assert 3 * (18 mod 5) = 9
500 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"54 div 5 * 3 \\-> 30 (from left to right)") //@praat assert 54 div 5 * 3 = 30
501 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"54 div (5 * 3) \\-> 3") //@praat assert 54 div (5 * 3) = 3
502 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"54 mod 5 * 3 \\-> 12") //@praat assert 54 mod 5 * 3 = 12
503 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"54 mod (5 * 3) \\-> 9") //@praat assert 54 mod (5 * 3) = 9
504 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The operators with the next highest precedence are #addition (+) and #subtraction (-), "
505 "evaluated from left to right:")
506 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"3 - 8 + 7 \\-> 2 (from left to right)") //@praat assert 3 - 8 + 7 = 2
507 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"3 - (8 + 7) \\-> -12 (use parentheses to change the order)") //@praat assert 3 - (8 + 7) = -12
508 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"3 + 8 * 7 \\-> 59 (multiplication before addition)") //@praat assert 3 + 8 * 7 = 59
509 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"(3 + 8) * 7 \\-> 77 (use parentheses to change the order)") //@praat assert (3 + 8) * 7 = 77
510 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"3 + - (2 \\^ 4) \\-> -13 (exponentiation, negation, addition)") //@praat assert 3 + - (2 ^ 4) = -13
511 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"3 + 5 / 2 + 3 \\-> 8.5") //@praat assert 3 + 5 / 2 + 3 = 8.5
512 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"(3 + 5) / (2 + 3) \\-> 1.6") //@praat assert (3 + 5) / (2 + 3) = 1.6
513 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The operators with the next highest precedence are the #comparison operators "
514 "(`=, <>, <, >, <=, >=`). These operators always yield 0 (%false) or 1 (%true):")
515 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"5 + 6 = 10 \\-> 0 (equal)") //@praat assert ( 5 + 6 = 10 ) = 0
516 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"5 + 6 = 11 \\-> 1") //@praat assert ( 5 + 6 = 11 ) = 1
517 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"5 + 6 <> 10 \\-> 1 (unequal)") //@praat assert ( 5 + 6 <> 10 ) = 1
518 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"5 + 6 <> 11 \\-> 0") //@praat assert ( 5 + 6 <> 11 ) = 0
519 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"5 + 6 < 10 \\-> 0 (less than)") //@praat assert ( 5 + 6 < 10 ) = 0
520 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"5 + 6 < 11 \\-> 0") //@praat assert ( 5 + 6 < 11 ) = 0
521 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"5 + 6 > 10 \\-> 1 (greater than)") //@praat assert ( 5 + 6 > 10 ) = 1
522 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"5 + 6 > 11 \\-> 0") //@praat assert ( 5 + 6 > 11 ) = 0
523 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"5 + 6 <= 10 \\-> 0 (less than or equal)") //@praat assert ( 5 + 6 <= 10 ) = 0
524 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"5 + 6 <= 11 \\-> 1") //@praat assert ( 5 + 6 <= 11 ) = 1
525 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"5 + 6 >= 10 \\-> 1 (greater or equal)") //@praat assert ( 5 + 6 >= 10 ) = 1
526 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"5 + 6 >= 11 \\-> 1") //@praat assert ( 5 + 6 >= 11 ) = 1
527 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The comparison operators are mainly used in #if, #while, and #until conditions.")
528 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The operators of lowest precedence are the #logical operators (#not, #and, and #or), of which #not has the "
529 "highest precedence and #or the lowest:")
530 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"not 5 + 6 = 10 \\-> 1") //@praat assert ( not 5 + 6 = 10 ) = 1
531 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"x > 5 and x < 10 (is x between 5 and 10?)")
532 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"not x <= 5 and not x >= 10 (means the same as the previous line, except if x is undefined)")
533 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"not (x <= 5 or x >= 10) (again means the same, except if x is undefined)")
534 /*@praat
535 x = 7
536 assert ( x > 5 and x < 10 ) = 1
537 assert ( not x <= 5 and not x >= 10 ) = 1
538 assert ( not (x <= 5 or x >= 10) ) = 1
539 x = 3
540 assert ( x > 5 and x < 10 ) = 0
541 assert ( not x <= 5 and not x >= 10 ) = 0
542 assert ( not (x <= 5 or x >= 10) ) = 0
543 x = 11
544 assert ( x > 5 and x < 10 ) = 0
545 assert ( not x <= 5 and not x >= 10 ) = 0
546 assert ( not (x <= 5 or x >= 10) ) = 0
547 x = undefined
548 assert ( x > 5 and x < 10 ) = 0
549 assert ( not x <= 5 and not x >= 10 ) = 1
550 assert ( not (x <= 5 or x >= 10) ) = 1
551 @*/
552 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"String comparison")
553 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`a$ = b$`")
554 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives the value %true (= 1) if the strings are equal, and %false (= 0) otherwise.")
555 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`a$ <> b$`")
556 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives the value %true if the strings are unequal, and %false otherwise.")
557 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`a$ < b$`")
558 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives %true if the string %`a$` precedes the string %`b$` in Unicode sorting order. "
559 "Thus, \"ha\" < \"hal\" and \"ha\" < \"ja\" are true, but \"ha\" < \"JA\" is false, "
560 "because all capitals precede all lower-case characters in the Unicode sorting order.")
561 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`a$ > b$`")
562 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"%true if %`a$` comes after %`b$` in Unicode sorting order. ")
563 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`a$ <= b$`")
564 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives the value %true if the string %`a$` precedes the string %`b$` in Unicode sorting order, "
565 "or if the strings are equal.")
566 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`a$ >= b$`")
567 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"%true if %`a$` comes after %`b$` or the two are equal.")
568 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"String concatenation and truncation")
569 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`a$ + b$`")
570 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"concatenates the two strings. After")
571 CODE1cxx . . $ `sys/ManPagesM.h:51:9`! (U"text$ = \"hallo\" + \"dag\"")
572 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the variable %`text$` contains the string “hallodag”.")
573 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`a$ - b$`")
574 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"subtracts the second string from the end of the first. After")
575 CODE2cxx . . $ `sys/ManPagesM.h:52:9`! (U"soundFileName$ = \"hallo.aifc\"")
576 CODE2cxx . . $ `sys/ManPagesM.h:52:9`! (U"textgridFileName$ = soundFileName$ - \".aifc\" + \".TextGrid\"")
577 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the variable %`textgridFileName$` contains the string \"hallo.TextGrid\". "
578 "If the first string %`a$` does not end in the string %`b$`, the result of the subtraction is the string %`a$`.")
579 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
580
581 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Formulas 4. Constants", U"ppgb", 20080318)
582 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##pi")
583 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"%\\pi, 3.14159265358979323846264338328")
584 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##e")
585 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"%e, 2.71828182845904523536028747135")
586 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##undefined")
587 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"a special value, see @undefined")
588 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
589
590 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Formulas 5. Mathematical functions", U"ppgb", 20200801)
591 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##abs (%x)")
592 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"absolute value")
593 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##round (%x)")
594 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"nearest integer; round (1.5) = 2")
595 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##floor (%x)")
596 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"round down: highest integer value not greater than %x")
597 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##ceiling (%x)")
598 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"round up: lowest integer value not less than %x")
599 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##sqrt (%x)")
600 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"square root: \\Vr%x, %x \\>_ 0")
601 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##min (%x, ...)")
602 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the minimum of a series of numbers, e.g. min (7.2, -5, 3) = -5")
603 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##max (%x, ...)")
604 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the maximum of a series of numbers, e.g. max (7.2, -5, 3) = 7.2")
605 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##imin (%x, ...)")
606 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the location of the minimum, e.g. imin (7.2, -5, 3) = 2")
607 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##imax (%x, ...)")
608 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the location of the maximum, e.g. imax (7.2, -5, 3) = 1")
609 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##sin (%x)")
610 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"sine")
611 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##cos (%x)")
612 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"cosine")
613 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##tan (%x)")
614 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"tangent")
615 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##arcsin (%x)")
616 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"arcsine, -1 \\<_ %x \\<_ 1")
617 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##arccos (%x)")
618 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"arccosine, -1 \\<_ %x \\<_ 1")
619 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##arctan (%x)")
620 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"arctangent")
621 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##arctan2 (%y, %x)")
622 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"argument angle")
623 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##sinc (%x)")
624 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"sinus cardinalis: sin (%x) / %x")
625 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##sincpi (%x)")
626 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"sinc__%\\pi_: sin (%\\pi%x) / (%\\pi%x)")
627 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##exp (%x)")
628 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"exponentiation: %e^%x; same as ##e\\^ %x")
629 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##ln (%x)")
630 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"natural logarithm, base %e")
631 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##log10 (%x)")
632 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"logarithm, base 10")
633 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##log2 (%x)")
634 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"logarithm, base 2")
635 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##sinh (%x)")
636 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"hyperbolic sine: (%e^%x - %e^^-%x^) / 2")
637 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##cosh (%x)")
638 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"hyperbolic cosine: (%e^%x + %e^^-%x^) / 2")
639 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##tanh (%x)")
640 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"hyperbolic tangent: sinh (%x) / cosh (%x)")
641 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##arcsinh (%x)")
642 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"inverse hyperbolic sine: ln (%x + \\Vr(1+%x^2))")
643 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##arccosh (%x)")
644 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"inverse hyperbolic cosine: ln (%x + \\Vr(%x^2−1))")
645 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##arctanh (%x)")
646 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"inverse hyperbolic tangent")
647 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##sigmoid (%x)")
648 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"#R \\-> (0,1): 1 / (1 + %e^^−%x^) or 1 − 1 / (1 + %e^%x)")
649 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##invSigmoid (%x)")
650 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"(0,1) \\-> #R: ln (%x / (1 − %x))")
651 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##erf (%x)")
652 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the error function: 2/\\Vr%\\pi __0_\\in^%x exp(-%t^2) %dt")
653 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##erfc (%x)")
654 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the complement of the error function: 1 - erf (%x)")
655 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##randomUniform (%min, %max)")
656 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"a uniform random real number between %min (inclusive) and %max (exclusive)")
657 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##randomInteger (%min, %max)")
658 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"a uniform random integer number between %min and %max (inclusive)")
659 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##randomGauss (%\\mu, %\\si)")
660 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"a Gaussian random real number with mean %\\mu and standard deviation %\\si")
661 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##randomPoisson (%mean)")
662 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"a Poisson random real number")
663 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##randomGamma (%%shape%, %%rate%)")
664 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"a random number drawn from a Gamma distribution with shape parameter %\\al "
665 "and rate parameter %\\be, which is defined as "
666 "%f(%x; %\\al, %\\be) = (1 / \\Ga (%\\al)) %\\be%^^%\\al^ %x^^%\\al−1^ %e^^−%\\be %x^, "
667 "for %x > 0, %\\al > 0 and %\\be > 0, following the method by @@Marsaglia & Tsang (2000)@")
668 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##random\\_ initializeWithSeedUnsafelyButPredictably (%seed)")
669 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"can be used in a script to create a reproducible sequence of random numbers "
670 "(warning: this exceptional situation will continue to exist throughout Praat until you call the following function)")
671 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##random\\_ initializeSafelyAndUnpredictably ()")
672 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"undoes the exceptional situation caused by the previous function")
673 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##lnGamma (%x)")
674 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"logarithm of the \\Ga function")
675 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##gaussP (%z)")
676 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the area under the Gaussian distribution between −\\oo and %z")
677 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##gaussQ (%z)")
678 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the area under the Gaussian distribution between %z and +\\oo: "
679 "the one-tailed \"statistical significance %p\" of a value that is %z standard deviations "
680 "away from the mean of a Gaussian distribution")
681 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##invGaussQ (%q)")
682 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the value of %z for which $gaussQ (%z) = %q")
683 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##chiSquareP (%`chiSquare`, %`df`)")
684 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the area under the %\\ci^2 distribution between 0 and %chiSquare, for %`df` degrees of freedom")
685 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##chiSquareQ (%`chiSquare`, %`df`)")
686 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the area under the %\\ci^2 distribution between %`chiSquare` and +\\oo, "
687 "for %df degrees of freedom: the \"statistical significance %p\" "
688 "of the %\\ci^2 difference between two distributions in %df+1 dimensions")
689 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##invChiSquareQ (%q, %df)")
690 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the value of %\\ci^2 for which $chiSquareQ (%\\ci^2, %df) = %q")
691 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##studentP (%t, %df)")
692 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the area under the student T-distribution from -\\oo to %t")
693 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##studentQ (%t, %df)")
694 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the area under the student T-distribution from %t to +\\oo")
695 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##invStudentQ (%q, %df)")
696 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the value of %t for which $studentQ (%t, %df) = %q")
697 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##fisherP (%f, %df1, %df2)")
698 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the area under Fisher's F-distribution from 0 to %f")
699 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##fisherQ (%f, %df1, %df2)")
700 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the area under Fisher's F-distribution from %f to +\\oo")
701 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##invFisherQ (%q, %df1, %df2)")
702 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the value of %f for which $fisherQ (%f, %df1, %df2) = %q")
703 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##binomialP (%p, %k, %n)")
704 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the probability that in %n experiments, an event with probability %p will occur at most %k times")
705 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"@`binomialQ` (%p, %k, %n)")
706 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the probability that in %n experiments, an event with probability %p will occur at least %k times; equals 1 - $binomialP (%p, %k - 1, %n)")
707 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##invBinomialP (%P, %k, %n)")
708 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the value of %p for which $binomialP (%p, %k, %n) = %P")
709 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"@`invBinomialQ` (%Q, %k, %n)")
710 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the value of %p for which $binomialQ (%p, %k, %n) = %Q")
711 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##hertzToBark (%x)")
712 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"from acoustic frequency to Bark-rate (perceptual spectral frequency; place on basilar membrane): "
713 "7 ln (%x/650 + \\Vr(1 + (%x/650)^2))")
714 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##barkToHertz (%x)")
715 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"650 sinh (%x / 7)")
716 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##hertzToMel (%x)")
717 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"from acoustic frequency to perceptual pitch: 550 ln (1 + %x / 550)")
718 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##melToHertz (%x)")
719 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"550 (exp (%x / 550) - 1)")
720 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##hertzToSemitones (%x)")
721 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"from acoustic frequency to a logarithmic musical scale, relative to 100 Hz: 12 ln (%x / 100) / ln 2")
722 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##semitonesToHertz (%x)")
723 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"100 exp (%x ln 2 / 12)")
724 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##erb (%f)")
725 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the perceptual %%equivalent rectangular bandwidth% (ERB) in hertz, for a specified acoustic frequency (also in hertz): "
726 "6.23\\.c10^^-6^ %f^2 + 0.09339 %f + 28.52")
727 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##hertzToErb (%x)")
728 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"from acoustic frequency to ERB-rate: 11.17 ln ((%x + 312) / (%x + 14680)) + 43")
729 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##erbToHertz (%x)")
730 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"(14680 %d - 312) / (1 - %d) where %d = exp ((%x - 43) / 11.17)")
731 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"@`phonToDifferenceLimens` (%x)")
732 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"from perceptual loudness (intensity sensation) level in phon, to the number of intensity "
733 "difference limens above threshold: 30 · ((61/60)^^ %x^ − 1).")
734 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"@`differenceLimensToPhon` (%x)")
735 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the inverse of the previous: ln (1 + %x / 30) / ln (61 / 60).")
736 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##beta (%x, %y)")
737 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##besselI (%n, %x)")
738 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##besselK (%n, %x)")
739 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"For functions with arrays, see @@Scripting 5.7. Vectors and matrices@.")
740 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
741
742 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Formulas 6. String functions", U"ppgb", 20180825)
743 INTROcxx . . $ `sys/ManPagesM.h:35:9`! (U"String functions are functions that either return a text string or have at least one text string as an argument. "
744 "Since string computations are not very useful in the @calculator, in settings windows, or in creation and "
745 "modification formulas, this page only gives examples of strings in scripts, so that the example may contain "
746 "string variables.")
747 /*@praat
748 string$ = "hallo"
749 length = length (string$ + "dag")
750 assert length = 8
751 @*/
752 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`length (a$)")
753 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives the length of the string. After")
754 CODE2cxx . . $ `sys/ManPagesM.h:52:9`! (U"string$ = \"hallo\"")
755 CODE2cxx . . $ `sys/ManPagesM.h:52:9`! (U"length = length (string$ + \"dag\")")
756 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the variable %`length` contains the number 8 (by the way, from this example "
757 "you see that variables can have the same names as functions, without any danger of confusing the interpreter).")
758 /*@praat
759 head$ = left$ ("hallo", 3)
760 assert head$ = "hal"
761 @*/
762 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`left$ (a$, n)")
763 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives a string consisting of the first %n characters of %`a$`. After")
764 CODE2cxx . . $ `sys/ManPagesM.h:52:9`! (U"head$ = left$ (\"hallo\", 3)")
765 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the variable %`head$` contains the string \"hal\".")
766 /*@praat
767 english$ = "he" + right$ ("hallo", 3)
768 assert english$ = "hello"
769 @*/
770 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`right$ (a$, n)")
771 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives a string consisting of the last %n characters of %`a$`. After")
772 CODE2cxx . . $ `sys/ManPagesM.h:52:9`! (U"english$ = \"he\" + right$ (\"hallo\", 3)")
773 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the variable %`english$` contains the string \"hello\".")
774 /*@praat
775 assert mid$ ("hello", 3, 2) = "ll"
776 @*/
777 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`mid$ (\"hello\" , 3, 2)")
778 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives a string consisting of 2 characters from “hello”, starting at the third character. Outcome: ll.")
779 /*@praat
780 where = index ("hallo allemaal", "al")
781 assert where = 2
782 assert index ("hallo allemaal", "fhjgfhj") = 0
783 @*/
784 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`index (a$, b$)")
785 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives the index of the first occurrence of the string %`b$` in the string %`a$`. After")
786 CODE2cxx . . $ `sys/ManPagesM.h:52:9`! (U"where = index (\"hallo allemaal\", \"al\")")
787 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the variable %`where` contains the number 2, because the first “al” starts at the second character of the longer string. "
788 "If the first string does not contain the second string, %`index` returns 0.")
789 /*@praat
790 where = rindex ("hallo allemaal", "al")
791 assert where = 13
792 assert rindex ("hallo allemaal", "fhjgfhj") = 0
793 @*/
794 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`rindex (a$, b$)")
795 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives the index of the last occurrence of the string %`b$` in the string %`a$`. After")
796 CODE2cxx . . $ `sys/ManPagesM.h:52:9`! (U"where = rindex (\"hallo allemaal\", \"al\")")
797 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the variable %`where` contains the number 13, because the last “al” starts at the 13th character. "
798 "If the first string does not contain the second string, %`rindex` returns 0.")
799 /*@praat
800 where = startsWith ("internationalization", "int")
801 assert where = 1
802 @*/
803 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`startsWith (a$, b$)")
804 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"determines whether the string %`a$` starts with the string %`b$`. After")
805 CODE2cxx . . $ `sys/ManPagesM.h:52:9`! (U"where = startsWith (\"internationalization\", \"int\")")
806 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the variable %`where` contains the number 1 (true).")
807 /*@praat
808 where = endsWith ("internationalization", "nation")
809 assert where = 0
810 @*/
811 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`endsWith (a$, b$)")
812 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"determines whether the string %`a$` ends with the string %`b$`. After")
813 CODE2cxx . . $ `sys/ManPagesM.h:52:9`! (U"where = endsWith (\"internationalization\", \"nation\")")
814 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the variable %where contains the number 0 (false).")
815 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`replace$ (a$, b$, c$, n)")
816 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives a string that is like %`a$`, but where (at most %n) occurrences of %`b$` are replaced with the string %`c$`. After")
817 CODE2cxx . . $ `sys/ManPagesM.h:52:9`! (U"s$ = replace$ (\"hello\", \"l\", \"m\", 0)")
818 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the variable %`s$` contains the string \"hemmo\". After")
819 CODE2cxx . . $ `sys/ManPagesM.h:52:9`! (U"s$ = replace$ (\"hello\", \"l\", \"m\", 1)")
820 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the variable %`s$` contains the string \"hemlo\". The number %n determines the maximum number of occurrences of %`b$` "
821 "that can be replaced. If %n is 0, all occurrences are replaced.")
822 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`index_regex (a$, b$)")
823 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"determines where the string %`a$` first matches the @@regular expressions|regular expression@ %`b$`. After")
824 CODE2cxx . . $ `sys/ManPagesM.h:52:9`! (U"where = index_regex (\"internationalization\", \"a.*n\")")
825 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the variable %`where` contains the number 7. If there is no match, the outcome is 0.")
826 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`rindex_regex (a$, b$)")
827 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"determines where the string %`a$` last matches the @@regular expressions|regular expression@ %`b$`. After")
828 CODE2cxx . . $ `sys/ManPagesM.h:52:9`! (U"where = rindex_regex (\"internationalization\", \"a.*n\")")
829 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the variable %`where` contains the number 16. If there is no match, the outcome is 0.")
830 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`replace_regex$ (a$, b$, c$, n)")
831 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives a string that is like %`a$`, but where (at most %n) substrings that match the @@regular expressions|regular expression@ %`b$` "
832 "are replaced with the expression %`c$`. After")
833 CODE2cxx . . $ `sys/ManPagesM.h:52:9`! (U"s$ = replace_regex$ (\"hello\", \".\", \"&&\", 0)")
834 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the variable %`s$` contains the string \"hheelllloo\". If there is no match, "
835 "the outcome is the original string %`a$`. After")
836 CODE2cxx . . $ `sys/ManPagesM.h:52:9`! (U"s$ = replace_regex$ (\"hello\", \".\", \"&&\", 1)")
837 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the variable %`s$` contains the string \"hhello\". The number %n determines the maximum number of text pieces "
838 "that can be replaced. If %n is 0, all matching text pieces are replaced.")
839 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`string$ (number)")
840 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"formats a number as a string. Thus, `string$ (5e6)` "
841 "becomes the string `5000000`, and `string$ (56%)` becomes the string `0.56`.")
842 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`fixed$ (number, precision)")
843 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"formats a number as a string with %precision digits after the decimal point. Thus, `fixed$ (72.65687, 3)` "
844 "becomes the string `72.657`, and `fixed$ (72.65001, 3)` becomes the string `72.650`. "
845 "In these examples, we see that the result can be rounded up and that trailing zeroes are kept. "
846 "At least one digit of precision is always given, e.g. `fixed$ (0.0000157, 3)` becomes the string `0.00002`. "
847 "The number 0 always becomes the string `0`.")
848 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`percent$ (number, precision)")
849 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the same as `fixed$` (), but with a percent sign. For instance, `percent$ (0.157, 3)` becomes `15.700%`, "
850 "`percent$ (0.000157, 3)` becomes `0.016%`, and `percent$ (0.000000157, 3)` becomes `0.00002%`. "
851 "The number 0 always becomes the string `0`.")
852 /*@praat
853 string$ = "5e6"
854 assert 3 + number (string$) = 5000003
855 @*/
856 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`number (a$)")
857 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"interprets a string as a number. After")
858 CODE2cxx . . $ `sys/ManPagesM.h:52:9`! (U"string$ = \"5e6\"")
859 CODE2cxx . . $ `sys/ManPagesM.h:52:9`! (U"writeInfoLine: 3 + number (string$)")
860 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the Info window contains the number 5000003.")
861 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`date$ ( )")
862 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives the date and time in the following format:")
863 CODE2cxx . . $ `sys/ManPagesM.h:52:9`! (U"Mon Jun 24 17:11:21 2002")
864 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"To write the day of the month into the Info window, you type:")
865 CODE2cxx . . $ `sys/ManPagesM.h:52:9`! (U"date$ = date$ ()")
866 CODE2cxx . . $ `sys/ManPagesM.h:52:9`! (U"day$ = mid$ (date$, 9, 2)")
867 CODE2cxx . . $ `sys/ManPagesM.h:52:9`! (U"writeInfoLine: \"The month day is \", day$, \".\"")
868 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`unicode$ (228)")
869 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives the 228th Unicode codepoint, i.e. \"ä\".")
870 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`unicode (\"ä\")")
871 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives the Unicode codepoint number of \"ä\", i.e. 228.")
872 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`extractNumber (\"Type: Sound\" + newline$ + \"Name: hello there\" + newline$ + \"Size: 44007\", \"Size:\")")
873 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"looks for a number after the first occurrence of “Size:” in the long string. Outcome: 44007. "
874 "This is useful in scripts that try to get information from long reports, as the following script that "
875 "runs in the Sound editor window:")
876 CODE2cxx . . $ `sys/ManPagesM.h:52:9`! (U"report$ = Editor info")
877 CODE2cxx . . $ `sys/ManPagesM.h:52:9`! (U"maximumFrequency = extractNumber (report$, \"Spectrogram window length:\")")
878 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`extractWord$ (\"Type: Sound\" + newline$ + \"Name: hello there\" + newline$ + \"Size: 44007\", \"Type:\")")
879 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"looks for a word without spaces after the first occurrence of \"Type:\" in the long string. Outcome: Sound.")
880 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`extractLine$ (\"Type: Sound\" + newline$ + \"Name: hello there\" + newline$ + \"Size: 44007\", \"Name: \")")
881 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"looks for the rest of the line (including spaces) after the first occurrence of “Name: ” in the long string. "
882 "Outcome: hello there. Note how “Name: ” includes a space, so that the “rest of the line” starts with the %h.")
883 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`backslashTrigraphsToUnicode$ (x$), unicodeToBackslashTrigraphs$ (x$)")
884 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"converts e.g. \\bsct to \\ct or the reverse. See @@Special symbols@.")
885 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
886
887 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Formulas 7. Control structures", U"ppgb", 20031228)
888 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"if ... then ... else ... fi")
889 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"You can use conditional expressions in all formulas. For example, ")
890 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"3 * if 52% * 3908 > 2000 then 5 else 6 fi")
891 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"evaluates to 15. Instead of #`fi`, you can also use #`endif`.")
892 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Another example: you can clip the absolute amplitude of a Sound to 0.5 by supplying the following formula:")
893 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"if abs(self)>0.5 then if self>0 then 0.5 else -0.5 fi else self fi")
894 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"The semicolon")
895 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The semicolon ends the evaluation of the formula. This can be convenient "
896 "if you do not want to overwrite a long formula in your text field: the formula")
897 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"800;sqrt(2)*sin(2*pi*103*0.5)+10^(-40/20)*randomGauss(0,1)")
898 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"evaluates to 800.")
899 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
900
901 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Formulas 8. Attributes of objects", U"ppgb", 20221202)
902 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"You can refer to several attributes of objects that are visible in the @@List of Objects@. "
903 "To do so, use either the unique ID of the object, or the type and the name of the object. "
904 "Thus, `object[113]` refers to the object that has the number 113 in the list, "
905 "and `object[\"Sound hallo\"]` refers to an existing Sound object whose name is “hallo” "
906 "(if there is more than one such object, it refers to the one that was created last).")
907 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"To refer to an attribute, you use the period (\".\"). "
908 "Thus, `object[\"Sound hallo\"].nx` is the number of samples of the Sound called `hallo`, and "
909 "`1/object[\"Sound hallo\"].dx` is its sampling frequency.")
910 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Attributes in the calculator")
911 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Record a Sound (read the @Intro if you do not know how to do that), "
912 "and name it `mysound` (or anything else). An object with a name like `3. Sound mysound` "
913 "will appear in the list. Then type into the @calculator the formula")
914 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"object[3].nx")
915 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"or")
916 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"object[\"Sound mysound\"].nx")
917 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"After you click OK, the Info window will show the number of samples. Since you could have got this result "
918 "by simply selecting the object and choosing ##Get number of samples# from the @@Query submenu@, "
919 "these attribute tricks are not very useful in the calculator. "
920 "We will see that they are much more useful in creation and modification formulas and in scripts.")
921 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"List of possible attributes")
922 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The following attributes are available:")
923 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`xmin`")
924 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the start of the time domain (usually 0) for a @Sound, @Pitch, @Formant, "
925 "@Spectrogram, @Intensity, @Cochleagram, @PointProcess, or @Harmonicity object, in seconds; "
926 "the lowest frequency (always 0) for a @Spectrum object, in hertz; "
927 "the lowest frequency (usually 0) for an @Excitation object, in Bark; "
928 "the left edge of the %x domain for a @Matrix object.")
929 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`xmax`")
930 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the end of the time domain (usually the duration, if %xmin is zero) for a Sound, Pitch, Formant, "
931 "Spectrogram, Intensity, Cochleagram, PointProcess, or Harmonicity object, in seconds; "
932 "the highest frequency (@@Nyquist frequency@) for a Spectrum object, e.g. 11025 hertz; "
933 "the highest frequency for an Excitation object, often 25.6 Bark; "
934 "the right edge of the %x domain for a Matrix object.")
935 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`ncol`")
936 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the number of columns in a @Matrix, @TableOfReal, or @Table object.")
937 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`nrow`")
938 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the number of rows in a @Matrix, @TableOfReal, or @Table object.")
939 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`col$` [%`i`]")
940 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the name of column %`i` in a @TableOfReal or @Table object.")
941 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`row$` [%`i`]")
942 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the name of row %`i` in a @TableOfReal object.")
943 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`nx`")
944 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the number of samples in a Sound object; "
945 "the number of analysis frames in a Pitch, Formant, Spectrogram, Intensity, Cochleagram, or Harmonicity object; "
946 "the number of frequency bins in a Spectrum or Excitation object; "
947 "the number of divisions of the %x domain for a Matrix object (= %`ncol`).")
948 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`dx`")
949 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the sample period (time distance between consecutive samples) in a Sound object (the inverse of the sampling frequency), in seconds; "
950 "the time step between consecutive frames in a Pitch, Formant, Spectrogram, Intensity, Cochleagram, or Harmonicity object, in seconds; "
951 "the width of a frequency bin in a Spectrum object, in hertz; "
952 "the width of a frequency bin in an Excitation object, in Bark; "
953 "the horizontal distance between cells in a Matrix object.")
954 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`ymin`")
955 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the lowest frequency (usually 0) for a Spectrogram object, in hertz; "
956 "the lowest frequency (usually 0) for a Cochleagram object, in Bark; "
957 "the bottom of the %y domain for a Matrix object.")
958 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`ymax`")
959 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the highest frequency for a Spectrogram object, e.g. 5000 hertz; "
960 "the highest frequency for a Cochleagram object, often 25.6 Bark; "
961 "the top of the %y domain for a Matrix object.")
962 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`ny`")
963 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the number of frequency bands in a Spectrogram or Cochleagram object; "
964 "for a Spectrum object: always 2 (first row is real part, second row is imaginary part) "
965 "the number of divisions of the %y domain for a Matrix object (= %`nrow`).")
966 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"#`dy`")
967 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the distance between adjacent frequency bands in a Spectrogram object, in hertz; "
968 "the distance between adjacent frequency bands in a Cochleagram object, in Bark; "
969 "the vertical distance between cells in a Matrix object.")
970 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Attributes in a creation formula")
971 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"In formulas for creating a new object, you can refer to the attributes of any object, "
972 "but you will often want to refer to the attributes of the object that is just being created. You can do that in two ways.")
973 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The first way is to use the name of the object, as above. Choose @@Create Sound from formula...@, supply %hello for its name, "
974 "supply arbitrary values for the starting and finishing time, and type the following formula:")
975 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"(x - object[\"Sound hello\"].xmin) / (object[\"Sound hello\"].xmax - object[\"Sound hello\"].xmin)")
976 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"When you edit this sound, you can see that it creates a straight line that rises from 0 to 1 within the time domain.")
977 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The formula above will also work if the Sound under creation is called %goodbye, and a Sound called %hello already exists; "
978 "of course, in such a case `object[\"Sound hello\"].xmax` refers to a property of the already existing sound.")
979 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"If a formula refers to an object under creation, there is a shorter way: you do not have to supply the name of the object at all, "
980 "so you can simply write")
981 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"(x - xmin) / (xmax - xmin)")
982 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The attributes that you can use in this implicit way are %xmin, %xmax, %ncol, %nrow, %nx, %dx, %ny, and %dy. "
983 "To disambiguate in case there exists a script variable %xmin as well "
984 "(Praat will complain if this is the case), you can write `Self.xmin`.")
985 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Attributes in a modification formula")
986 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"In formulas for modifying an existing object, you refer to attributes in the same way as in creation formulas, "
987 "i.e., you do not have to specify the name of the object that is being modified. The formula")
988 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"self * 20 ^ (- (x - xmin) / (xmax - xmin))")
989 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"causes the sound to decay exponentially in such a way that it has only 5 percent of its initial amplitude at the end. "
990 "If you apply this formula to multiple Sound objects at the same time, $xmax will refer to the finishing time of each Sound separately "
991 "as that Sound is modified.")
992 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"More examples of the use of attributes are on the next page.")
993 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
994
995 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Formulas 9. Data in objects", U"ppgb", 20170614)
996 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"With square brackets, you can get the values inside some objects.")
997 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Object contents in the calculator")
998 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The outcomes of the following examples can be checked with the @calculator.")
999 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##object [%%objectName\\$ or id%, %rowNumber, %columnNumber]")
1000 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"$$object [\"Matrix hello\", 10, 3]")
1001 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives the value in the cell at the third column of the 10th row of the Matrix called %hello.")
1002 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"$$object [5, 10, 3]")
1003 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives the value in the cell at the third column of the 10th row of the Matrix whose unique ID is 5 "
1004 "(i.e. that is labelled with the number 5 in the list of objects).")
1005 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"$$object [\"Sound hello\", 0, 10000]")
1006 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives the value (in Pa) of the 10000th sample of the Sound %hello, averaged over the channels.")
1007 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"$$object [23, 1, 10000]")
1008 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives the value (in Pa) of the 10000th sample of the left channel of the Sound with ID 23.")
1009 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"$$object [23, 2, 10000]")
1010 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives the value (in Pa) of the 10000th sample of the right channel of the Sound with ID 23.")
1011 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"$$object [\"TableOfReal tokens\", 5, 12]")
1012 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives the value in the cell at the fifth row of the 12th column of the TableOfReal called %tokens.")
1013 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"$$object [\"TableOfReal tokens\", 5, \"F1\"]")
1014 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives the value in the cell at the fifth row of the column labelled %F1 of the TableOfReal %tokens.")
1015 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"$$object [\"TableOfReal tokens\", \"\\bsct\", \"F1\"]")
1016 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives the value in the cell at the row labelled %%\\bsct% of column %F1 of the TableOfReal %tokens.")
1017 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"$$object [\"Table listeners\", 3, \"m3ae\"]")
1018 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives the numeric value in the cell at the third row of column %m3ae of the Table %listeners.")
1019 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"$$object [\"Table listeners\", 3, 12]")
1020 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives the numeric value in the cell at the third row of the 12th column of the Table %listeners.")
1021 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"$$object\\$ [\"Table results\", 3, \"response\"]")
1022 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives the string value in the cell at the third row of column %response of the Table %results.")
1023 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"$$object\\$ [\"Table results\", 3, 12]")
1024 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives the string value in the cell at the third row of the 12th column of the Table %results.")
1025 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"$$object [\"PitchTier hello\", 8]")
1026 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives the pitch (in Hertz) of the 8th point in the PitchTier %hello.")
1027 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Cells (or samples, or points) outside the objects are considered to contain zeroes.")
1028 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Interpolation")
1029 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The values inside some objects can be interpolated.")
1030 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"$$object (\"Sound hello\", 0.7, 0)")
1031 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives the value (in Pa) at a time of 0.7 seconds in the Sound %hello, by linear interpolation between "
1032 "the two samples that are nearest to 0.7 seconds. The channels are averaged.")
1033 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"$$object (\"Sound hello\", 0.7, 1)")
1034 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives the interpolated value (in Pa) at a time of 0.7 seconds in the left channel of the Sound %hello.")
1035 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"$$object (\"Sound hello\", 0.7, 2)")
1036 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives the interpolated value (in Pa) at a time of 0.7 seconds in the right channel of the Sound %hello.")
1037 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"$$object (\"Spectrogram hallo\", 0.7, 2500)")
1038 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives the value at a time of 0.7 seconds and at a frequency of 2500 Hz in the Spectrogram %hallo, "
1039 "by linear interpolation between the four samples that are nearest to that point.")
1040 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"$$object (\"PitchTier hullo\", 0.7)")
1041 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"gives the pitch (in Hertz) at a time of 0.7 seconds in the PitchTier %hullo.")
1042 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"In the interpolation, times outside the time domain of the objects are considered to contain zeroes (this does not apply to PitchTiers and the like, "
1043 "which undergo @@constant extrapolation@).")
1044 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Object contents in a modification formula")
1045 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Suppose you want to do the difficult way of reversing the contents of a Sound called `hello` (the easy way is to choose #Reverse "
1046 "from the @Modify menu). You select this sound, then choose @@Copy...@ to duplicate it to a new Sound, which you name `hello_reverse`. "
1047 "You select this new Sound and choose ##Formula...# from the @Modify menu. The formula will be")
1048 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"object [\"Sound hello\", row, ncol + 1 - col]")
1049 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"From this example, you see that the indices between [ ] may be formulas themselves, and that you can use implicit attributes like %ncol "
1050 "and position references like %col (also %row, which here means that the reversal is performed for each channel). "
1051 "An alternative formula is")
1052 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"object (\"Sound hello\", xmax - x, y)")
1053 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"at least if %xmin is zero. The advantage of the second method is that it also works correctly if the two sounds have different sampling frequencies; "
1054 "the disadvantage is that it may do some interpolation between the samples, which deteriorates the sound quality "
1055 "(the use of %y here means that the reversal is done for all %y values, i.e. all channels).")
1056 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Object contents in a script")
1057 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"In scripts, the indices between [ ] and the values between ( ) may be formulas themselves and contain variables. "
1058 "The following script computes the sum of all the cells along the diagonal of a Matrix.")
1059 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"matrix = Create simple matrix: 10, 10, \"x*y\"")
1060 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"sumDiagonal = 0")
1061 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"for i to object[matrix].ncol")
1062 CODE1cxx . . $ `sys/ManPagesM.h:51:9`! (U"sumDiagonal += object [matrix, i, i]")
1063 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"endfor")
1064 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"writeInfoLine: \"The sum of the cells along the diagonal is \", sumDiagonal, \".\"")
1065 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"This example could have been written completely with commands from the dynamic menu:")
1066 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"matrix = Create simple matrix: 10, 10, \"x*y\"")
1067 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"sumDiagonal = 0")
1068 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"ncol = Get number of columns")
1069 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"for i to ncol")
1070 CODE1cxx . . $ `sys/ManPagesM.h:51:9`! (U"value = Get value in cell: i, i")
1071 CODE1cxx . . $ `sys/ManPagesM.h:51:9`! (U"sumDiagonal += value")
1072 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"endfor")
1073 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"writeInfoLine: \"The sum of the cells along the diagonal is \", sumDiagonal, \".\"")
1074 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The first version, which accesses the contents directly, is not only two lines shorter, but also three times faster.")
1075 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
1076
1077 }
1078
1079 /* End of file manual_formulas.cpp */