 
DPGraph
documentation. More DPGraph documentation is available by clicking on Help
inside DPGraph. When we finish incorporating DPGraph's dynamic 3D functionality
into Flaming Thunder, we'll also incorporate the documentation into Flaming
Thunder's documentation.
Examples:
Hello world!
Mad libs
See all the digits of 69!
Calculating factorials
Seive of Eratosthenes
A "Hello world!" CGI script
IP address CGI script
All environment variables CGI script
Greenwich Mean Time CGI script
Say hello CGI script
Small red 3D triangle
Blue 3D cube
Green rotating 3D cube
Golden rotating 3D cube on a tiled floor
Language Reference Index:
Command Line Parameters
The syntax to invoke Flaming Thunder from the command line is:
FT FILE inputfilename OUTPUT outputfilename TARGET targetname
The case of the letters doesn't matter to Flaming Thunder, although if you
are working on a system with casesensitive file names then the case of
inputfilename and outputfilename should correspond to the
file names in the file system.
The inputfilename must end in .ft so that
Flaming Thunder doesn't accidentally overwrite the input file when it
generates one or more of the output files.
The valid values for targetname are All, FreeBSD32,
FreeBSD64, Linux32, Linux64, MacOSX32,
MacOSX64, Windows32 and Windows64.
The output outputfilename and target targetname
pairs are optional. If the target isn't specified, then Flaming Thunder
generates the executable for your current machine and operating system. If
output is specified, then you cannot use target all.
Examples: ft file helloworld.ft
ft file IPAddress.ft output IPAddress.cgi target linux32
ft file classnotes.ft target all

File Format
A Flaming Thunder program is a sequence of 8bit bytes. These 8bit bytes
are interpreted as characters. These characters are in turn grouped together to
form the words, numbers, strings and symbols that comprise a Flaming Thunder
program.
Examples: # Here is a small Flaming Thunder program.
Write "Hello world!".
# Here is another small program.
Write 1_000!.

Lines
For readability, Flaming Thunder programs are usually broken into lines.
This is not necessary, though. An entire program can be contained on a single
line.
There is no arbitrary limit on the length of lines. A line can be as
long as the maximum file size allowed by the operating system.
The end of a line is marked by a linefeed character, 0x0A. The linefeed
character may be preceeded by a carriage return character, 0x0D. A carriage
return character that isn't followed by a linefeed will be flagged as an
error.
Flaming Thunder doesn't care whether or not the last line in the file has end of line
characters after it.
Examples: # Here is an entire program on one line.
Set x to 10. Write x^x.
# Here is one statement split across lines.
Write "Four score and seven years ago ",
"our fathers brought forth ",
"on this continent a new nation ...".

Comments
Flaming Thunder uses # as a comment character. Flaming Thunder ignores all the 8bit bytes on a line
from the comment character through the end of the line.
Comments may contain any characters other than linefeeds because linefeeds
mark the end of the comment.
Some programming languages, such as C, have multiline comments. Flaming
Thunder does not have multiline comments. Multiline comments are bad
programming practice because someone reading your program can't tell if a
section of code is executed or not because it may be included in a large block
of code that has been commented out.
Examples: Set x to 10. # Set the variable x to 10.
Set y to 20. # Set the variable y to 20.

Symbols
The symbols recognized by the Flaming Thunder compiler are:
.  —  end of statement. 
,  —  separates expressions. 
:  —  end of label. 
(  —  groups expressions and statements. 
)  —  groups expressions and statements. 
"  —  begins and ends strings. 
+  —  addition, or unary plus. 
  —  subtraction, or unary minus. 
*  —  multiplication. 
/  —  division. 
^  —  exponentiation (raise to a power). 
!  —  factorial. 
=  —  equals. 
<  —  less than. 
>  —  greater than. 
<=  —  less than or equal. 
>=  —  greater than or equal. 
<>  —  not equal. 
Some of the symbols have two characters, but they are treated as one
symbol. The twocharacter symbols can't have any other characters, including
space or underscores, between the two characters.
The # character is used to start comments, but it is ignored along
with the rest of the comment and isn't treated as a symbol.
The _ character can be used to create visual breaks in words and
numbers, but it is ignored by Flaming Thunder.
The word pairs and triplets IS A, IS AN, IS NOT A and IS NOT AN are
treated somewhat like symbols in that together they describe a single
operation, but arbitrary amounts of white space (spaces, tabs, comments, end of lines)
can appear between them.
Examples: Set x to y = 1 + 2*x^7!.
If x is an error
then set x to (15+x)*2.

Words
A word is a letter followed by zero or more letters, digits, or underscores.
White space (spaces, comments, ends of lines) can occur between a pair of
underscores in a word; this allows extremely long words to be split across
lines, which is the same method used to split extremely long numbers across
lines.
There is no maximum limit on the number of letters and digits in a
word. Uppercase and lower case words are considered to be
identical and underscores are ignored.
Computer programmers often call words "identifiers".
Examples: Write This_ # Start of write procedure.
_is_
_an_
_extremely_
_long_
_word. # Writes thisisanextremelylongword.
W_R_I_T_E 10_000. # Flaming Thunder treats
WrItE 10000. # these identically.

Reserved Words
These words are reserved; they can't be redefined because Flaming Thunder
then wouldn't understand the structure of your program:
and,
divides,
do,
doing,
down,
else,
error,
false,
for,
forever,
function,
go,
if,
integer,
interval,
is,
local,
mod,
not,
of,
or,
real,
return,
set,
string,
then,
times,
to,
true,
unset,
until,
variable.
while.
There are two words that Flaming Thunder uses to understand the structure
of your program, but that you can also use as variables because Flaming
Thunder can disambiguate your meaning based on the context:
a, an.
Reserved words are also often called keywords.
Examples: # A and AN can be used as variables because they
# always follow IS or IS NOT when used to
# structure your program.
Set an to GetParameter(1).
If an is an error then go to ErrorHandler.

Strings
Strings are quoted text that your program can manipulate.
Strings start with a doublequote character (") and end with
a doublequote character. If you want to include a doublequote
character in a string, put two doublequote characters together.
Strings may include any bytes with hexadecimal codes from 0x20
(" ") through 0xFF.
Spaces are allowed in strings, but tabs characters (0x09) are not.
Tabs in strings are ambiguous because the compiler can't tell if you
wanted the tab expanded to spaces, or if you wanted the actual tab
character in the string. If you want a string with a tab in it,
use the Tab predefined string constant.
You can concatenate strings using the + sign.
Examples: Write "This is a string.". # Writes: This is a string.
Write """Yes,"" he said." # Writes: "Yes," he said.
Write "Before tab" + Tab + "after tab".

Integers
Integers are numbers with no decimal point. Integers can contain any
number of digits. Integers can also contain underscores, which are ignored.
Integers can be broken across lines by ending one section with an underscore,
and resuming the next section with an underscore.
Examples: # Long integers are easier to read
# with underscores.
Write 10_000_000_000.
# Integers can be broken across lines.
Write 10_000_000_000_
_000_000_000_
_000_000_000.

Reals
Reals are numbers with a decimal point (floating point notation). Reals must
have at least one digit before the decimal point and at least one digit after
the decimal point so that Flaming Thunder can distinguish a real from an integer
with a period after it at the end of a statement. Reals can contain any number
of digits. Reals can also contain underscores, which are ignored. Reals can be
broken across lines by ending one section with an underscore, and resuming the
next section with an underscore.
Reals "poison" a calculation. Anytime a calculation involves a real and an
integer, the result will be a real. That's because reals are often
approximations, so the appearance of a decimal point in your result will alert
you that your result might be approximate.
Examples: Set x to 123.4*10^3.
Set y to 123.456_789.

Intervals
INTERVAL ( minimum, maximum )
Intervals allow you to do arithmetic with imprecise data and keep track of
how imprecise it is.
Intervals "poison" a calculation. Anytime a calculation involves an interval
and a real or integer, the result will be an interval. If an interval appears
as the result of a calculation, it tells you the bounds that your result is
guaranteed to lie within.
The bounds maintained by intervals can be greater than the actual maximum
bounds because Flaming Thunder doesn't currently keep track of the correlations
between different parts of the calculation. For example, the following
program:
Set x to interval(1.1, 1.2).
Set y to interval(1.1, 1.2).
Writeline xy.
Writeline xx.
writes:
interval(0.1,0.1)
interval(0.1,0.1)
The 1st interval is correct because x and y are
different variables, but the 2nd interval is too large because xx
is always exactly 0.
Examples: Set x to interval(10.10.001, 10.1+0.001).
Set y to 5*interval(0.1, 0.1).

Order of Operations
The order of operations in Flaming Thunder is the same as in standard
mathematics. For example, in the expression 4+5*6*7 the multiplications are
performed before the addition, and the multiplications are performed
lefttoright.
All operations of the same priority are performed lefttoright except for ^
(raising to a power), which is performed righttoleft. That conforms to
standard mathematical useage, where 2^{32} is interpreted as
2^(3^2) = 2^9 = 512, instead of (2^3)^2 = 2^(3*2) = 2^6 = 64.
First  (...), function(...), constants 
 ! 
 unary  and unary + in an exponent 
 ^ 
 unary  and unary + not in an exponent 
 *, /, MOD 
 +,  
 =, <, >, <=, >=, <>, IS A, IS NOT A, DIVIDES 
 NOT 
Last  AND, OR 
Examples: If 11 divides x then write "divisible by 11".
If x mod 7 = 5 then write "x = 7*y + 5".
Write 2^3^2. # Writes 512.
Set x to 10^2. # 10^2 = (10^2) = 100.
Set x to 10^2. # 10^2 = 10^(2) = 1/100.

Statements and Labels
A Flaming Thunder program is a list of statements and labels in a file. The
statements are usually executed onebyone starting with the first statement in the
file. Statements end with periods.
A label is a word followed by a colon. Labels are used to mark locations in
a statement list. More than one statement or label can be placed on each line
and statements can be split across lines.
Examples: If x<10 then go to ErrorLabel.
Write "Success".
Go to endlabel.
ErrorLabel:
Write "Error".
End_Label:

Compound Statement
( listofstatementsandlabels )
A compound statement a list of statements and labels inside parentheses.
Compound statements can occur anywhere a statement is called for. An empty
compound statement  ()  can serve as a "do nothing" statement.
Examples: (If x<10 then go to end. Write 2*x. Read x. End:)
# A single statement in a compound statement.
(for y from 1 to 20 do set sum to sum+y.)
If x=0 then # If x is zero, get a new x and y.
(
Write "Enter x: ".
ReadLine x. # Get x.
Write "Enter y: ".
ReadLine y. # Get y.
).
Write x.
Write y.
# An empty compound statement.
if x<10 then () else set x to 5.

For Statement
FOR variable FROM expression1 TO
expression2 DO statement
FOR variable FROM expression1 DOWN TO
expression2 DO statement
FOR expression TIMES DO statement
FOR FOREVER DO statement
A for statement executes a loop a specific number of times.
A forto statement is exactly equivalent to:
Set variable to expression1.
Set temporaryvariable to expression2.
TemporaryLabel1:
If (variable <= temporaryvariable) <> true go to TemporaryLabel2.
Statement.
Set variable to variable+1.
Go to TemporaryLabel1.
TemporaryLabel2:
A fordownto statement is exactly equivalent to:
Set variable to expression1.
Set temporaryvariable to expression2.
TemporaryLabel1:
If (variable >= temporaryvariable) <> true go to TemporaryLabel2.
Statement.
Set variable to variable1.
Go to TemporaryLabel1.
TemporaryLabel2:
A fortimes statement is exactly equivalent to:
Set temporaryvariable to expression.
TemporaryLabel1:
If (temporaryvariable <> 0) <> true go to TemporaryLabel2.
Statement.
Set temporaryvariable to temporaryvariable1.
Go to TemporaryLabel1.
TemporaryLabel2:
A forforever statement is exactly equivalent to:
TemporaryLabel:
Statement.
Go to TemporaryLabel.
Examples: Set sum to 0.
For i from 0 to 255 do set sum to sum + 2^i.
Set x to interval( 1.1, 1.2).
Set z to interval( 1.01, 1.02).
For i from 0 to 3 do
(
Set x to x^2.
Set z to z+x.
).
Write z.
For 80 times do write "*".
For forever do
(
Write "Do you know the definition of insanity? ".
Read response.
).

Function Statement
functionname IS A FUNCTION( listofparameters ) DOING statement
A function statement defines a function. The first return statement that
gets executed in the function determines the value that the function
returns.
Functions can be recursive. That is, a function can call itself.
Functions can be nested. You can define functions within functions.
Functions do not have to be declared before they are used. You can put all
of your function statements in alphabetical order at the end of your program,
glossary style.
If you want your function to execute multiple statements, put them in
parentheses to form a compound statement.
When a function is called, the parameters are always evaluated in
lefttoright order.
Examples: # A simple function.
Radius is a function(x,y) doing return squareroot(x^2+y^2).
# A recursive function.
Factorial is a function(n) doing
if n = 0 then return 1 else return n*factorial(n1).
# Nested functions in a compound statement.
Distance is a function(x1,x2,x3,y1,y2,y3) doing
(
Return squareroot( square(y1x1)+square(y2x2)+square(y3x3) ).
Square is a function(w) doing return w*w.
).

Go To Statement
GO TO label
A goto statement tells the compiler that instead of performing the next
statement, it should continue processing statements at the label.
Examples: if x<10
then go to XAlreadySmall
else set x to x1.
XAlreadySmall:
Set x to GetParameter(2).
If x is an error then go to ErrorMessage.
Go to x_is_not_an_error.
ErrorMessage: Write "Error".
XIsNotAnError:

If Statement
IF expression THEN statement
IF expression THEN statement1 ELSE statement2
An ifthenelse statement can be ambiguous if it has another if statement
nested inside of it. Flaming Thunder resolves the ambiguity the same way that
most other programming languages do — by pairing each else with the most
recent unpaired then.
For example, Flaming Thunder interprets
If expression1
then
if expression2
then statement1
else statement2.
as
If expression1
then
(if expression2
then statement1
else statement2.).
and not as:
If expression1
then
(if expression2
then statement1.)
else statement2.
Examples: If x<10 then go to AllDone.
If x<5 then
if x<2
then write "x<2"
else write "x>=2 and x<5"
else write "x>=5".

Procedure Call Statement
procedurename parameter1, parameter2, ..., parametern
A procedure call passes 0 or more parameters to a procedure, which performs
some action on the parameters. Unlike functions, procedures typically don't
return a value; the procedure is called because of the actions it performs and
not because of any value it returns.
The number of parameters for a procedure depends on the procedure. The
WriteLine procedure can take any number of parameters; the Read procedure must
have one and only one parameter, and it must be a variable.
Examples: # Writeline called with 0 parameters
# writes a blank line.
Writeline.
# ReadLine reads a line of input from
# standard input (usually the command
# line prompt) and saves it in a
# variable.
ReadLine user_input.

Repeat Statement
REPEAT statement UNTIL expression
A repeat statement repeatedly executes a statement until the expression
doesn't evaluate to true.
The difference between a repeat statement and a while statement is that a
repeat statement always executes statement at least once because the repeat
statement evaluates expression at the end of the loop.
A repeat statement is exactly equivalent to:
TemporaryLabel:
Statement.
If expression = true go to TemporaryLabel.
Examples: Set x to 3.
Repeat set x to x+x^2 until x>1_000_000.
Write x.
Repeat
(
Write "I'm not going to stop ",
"until you type quit.".
Read UserInput.
)
Until UserInput = "quit".

Return Statement
RETURN expression
A return statement determines the value returned by a function.
Examples: Double is a function(n) doing return n+n.
GetMagnitudeName is a function(n) doing
(
Set AbsN to AbsoluteValue(n).
If AbsN < 10 then return "ones".
If AbsN < 100 then return "tens".
If AbsN < 1000 then return "hundreds".
If AbsN < 10000 then return "thousands".
Return "gazillions".
).

Set Statement
SET variable TO expression
Sets a variable to the value of the expression. To unset a variable, use an
unset statement.
Examples: Set i to 123*234.
Set x to interval(1.2, 1.3).

Unset Statement
UNSET variable
Undoes any previous set statements for the variable. After a
variable is unset it will be treated symbolically.
Examples: Set i to 10.
WriteLine i^3. # Will write 1000.
Unset i.
WriteLine i^3. # Will write i^3.
Unset x. # Unsetting an already unset variable
# has no effect.

Variable Declaration Statement
identifier IS A VARIABLE
Explicity declares that the identifier is a variable. Explicity declaring a
variable makes it local to the context (program or function) that it is declared
it, and makes it global to contexts that are nested in the variable's
context.
Variables do not have to be explicity declared. If a variable is used
without being declared, Flaming Thunder internally creates a variable
declaration for it in the highest context that the variable appears in.
Examples: f is a function(x) doing (
a is a variable. # a is local to this function.
set a to 3.
return a*x.
).
f is a function(x) doing (
set a to 3. # if a is used in a higher level,
return a*x. # then a refers to the higher level a.
).

While Statement
WHILE expression DO statement
A while statement repeatedly evaluates an expression, and as long as the
expression is true, it executes the statement.
The difference between a while statement and a repeat statement is that a
while statement might not execute statement because it evaluates the expression
before looping.
A while statement is exactly equivalent to:
TemporaryLabel1:
If expression <> true go to TemporaryLabel2.
Statement.
Go to TemporaryLabel1.
TemporaryLabel2:
Examples: While True Do (Read x. Write x.). # Infinite loop.
# Find the highest 4th power that's
# less than or equal to a million.
Set i to 1.
While i^4 <= 1_000_000 do set i to i+1.
Set i to i1. # Decrement to cancel last increment.
WriteLine "i = ", i, " and i^4 = ", i^4.

Builtin Functions, Constants and Procedures
Most of the builtin functions, constants and procedures are
selfexplanatory.
AbsoluteValue  Function  Absolute value. 
Acos  Function  Inverse cosine (arccosine). 
Acosh  Function  Inverse hyperbolic cosine. 
Acot  Function  Inverse cotangent (arccotangent). 
Acoth  Function  Inverse hyperbolic cotangent. 
Acsc  Function  Inverse cosecant (arccosecant). 
Acsch  Function  Inverse hyperbolic cosecant. 
Asec  Function  Inverse secant (arcsecant). 
Asech  Function  Inverse hyperbolic secant. 
Asin  Function  Inverse sine (arcsine). 
Asinh  Function  Inverse hyperbolic sine. 
Atan  Function  Inverse tangent (arctangent). 
Atanh  Function  Inverse hyperbolic tangent. 
BaseE  Constant  The base of the natural logarithms: 2.718... . 
BeginFrame  Procedure  Begins the current animation frame. After you begin the frame, you can draw in it. Nothing you draw will be visible on the screen, however, until you EndFrame and then DrawFrame. 
BeginFullScreen  Procedure  Begins fullscreen graphics mode. Pressing Esc will set RequestedToStop to true. You can use W, A, S, and D to move around, or you can use the arrow keys. Moving your mouse will change the direction you are looking. You are in a righthanded 3D coordinate system with x horizontal, y pointing into the screen, and z vertical. You are initially at (0,8,1.5) and you are facing the origin. You can interpret the units as meters: your eye is 1.5 meters (roughly the average human eye height) above the ground, and you are 8 meters back along the y axis from the origin. 
ByteCharacter  Function  ByteCharacter(integer) converts an integer from 0 to 255 into a string of length 1. 
CarriageReturn  Constant  Carriage return character. 
Cos  Function  Cosine. 
Cosh  Function  Hyperbolic cosine. 
Cot  Function  Cotangent. 
Coth  Function  Hyperbolic cotangent. 
Csc  Function  Cosecant. 
Csch  Function  Hyperbolic cosecant. 
Draw3DLineXYZ2RGB  Procedure  Draws a 3D quadrilateral with vertices at the specified X, Y, and Z coordinates, and in the color specified by the R (red), G (green) and B (blue) values. An R, G, or B value of 0 means none of that color should be mixed in; an RGB value of 1 means the maximum amount should be mixed in. The quadrilateral is visible from both sides. 
Draw3DPointXYZRGB  Procedure  Draws a 3D quadrilateral with vertices at the specified X, Y, and Z coordinates, and in the color specified by the R (red), G (green) and B (blue) values. An R, G, or B value of 0 means none of that color should be mixed in; an RGB value of 1 means the maximum amount should be mixed in. The quadrilateral is visible from both sides. 
Draw3DQuadrilateralXYZ4RGB  Procedure  Draws a 3D quadrilateral with vertices at the specified X, Y, and Z coordinates, and in the color specified by the R (red), G (green) and B (blue) values. An R, G, or B value of 0 means none of that color should be mixed in; an RGB value of 1 means the maximum amount should be mixed in. The quadrilateral is visible from both sides. 
Draw3DTriangleXYZ3RGB  Procedure  Draws a 3D triangle with vertices at the specified X, Y, and Z coordinates, and in the color specified by the R (red), G (green) and B (blue) values. An R, G, or B value of 0 means none of that color should be mixed in; an RGB value of 1 means the maximum amount should be mixed in. The triangle is visible from both sides. 
DrawFrame  Procedure  After you EndFrame, DrawFrame will display your frame on the screen. 
EndFrame  Procedure  Ends the current animation frame. 
EndFullScreen  Procedure  Ends full screen mode. 
False  Constant  False. 
Find  Function  Find(needle,haystack), Find(needle,haystack,position), Find(needle,haystack,position,length) finds needle in haystack beginning at the 1based position in the next length characters. Returns 0 if needle not found, otherwise it returns the 1based starting position of needle. 
GetByteValue  Function  GetByteValue(string) converts a string of length 1 into an integer from 0 to 255. 
GetDecodedCGIVariableCount  Function  GetDecodedCGIVariableCount() returns the number of CGI variables. 
GetDecodedCGIVariableFileCount  Function  GetDecodedCGIVariableFileCount(i) or GetDecodedCGIVariableFileCount(name) returns the number of files from a type=file CGI variable. 
GetDecodedCGIVariableFileData  Function  GetDecodedCGIVariableFileData(i,j) or GetDecodedCGIVariableFileData(name,j) returns the file data from the j'th file in a type=file CGI variable. 
GetDecodedCGIVariableFileName  Function  GetDecodedCGIVariableFileName(i,j) or GetDecodedCGIVariableFileName(name,j) returns the file name of the j'th file in a type=file CGI variable. 
GetDecodedCGIVariableIndex  Function  GetDecodedCGIVariableIndex(name) returns index i of the CGI variable. 
GetDecodedCGIVariableName  Function  GetDecodedCGIVariableName(i) returns the name of the i'th CGI variable. 
GetDecodedCGIVariableValue  Function  GetDecodedCGIVariableValue(i) or GetDecodedCGIVariableValue(name) returns the value of the CGI variable. 
GetEnvironmentVariableCount  Function  GetEnvironmentVariableCount() returns the number of environment variables. 
GetEnvironmentVariableName  Function  GetEnvironmentVariableName(i) returns the name (everything before the 1st equals sign) of the i'th environment variable, where i is from 1 to GetEnvironmentVariableCount(). 
GetEnvironmentVariablePair  Function  GetEnvironmentVariablePair(i) returns the entire environment variable string, where i is from 1 to GetEnvironmentVariableCount(). 
GetEnvironmentVariableValue  Function  GetEnvironmentVariableValue(i) or GetEnvironmentVariableValue(name) returns the value (everything after the 1st equals sign, or an empty string if there is no equals sign) of the requested environment variable. 
GetGreenwichMeanTime  Function  GetGreenwichMeanTime() returns the current Greenwich Mean Time as a string (example: "Mon, 17 Mar 2008 11:53:36 GMT") in the format required by most internet protocols, as described in RFC 2616: Hypertext Transfer Protocol  HTTP/1.1; Date/Time Formats. 
GetParameter  Function  GetParameter(i) returns the i'th command line parameter, where i is from 1 to GetParameterCount(). 
GetParameterCount  Function  GetParameterCount() returns the number of command line parameters. 
GetStringLength  Function  GetStringLength(string) returns the length of the string. 
GetTimeInSeconds  Function  GetTimeInSeconds() returns the number of seconds since Jan 1, 1601 as a real number (for example, 12851007789.703125). 
GetUndecodedCGIData  Function  GetUndecodedCGIData() returns the raw undecoded CGI data. 
GetUndecodedCGIDataSize  Function  GetUndecodedCGIDataSize() returns the size of the raw undecoded CGI data. 
GreatestCommonDivisor  Function  GreatestCommonDivisor(a,b,c,...) returns the greatest common divisor of a, b, c, .... 
Join  Function  Join(a,b,c,...) joins the lists a, b, c, ... together and returns them as a single list. 
LeastCommonMultiple  Function  LeastCommonMultiple(a,b,c,...) returns the least common multiple of a, b, c, .... 
Linefeed  Constant  Linefeed character. 
List  Function  List(a,b,c,...) creates a list containing the objects a, b, c, ... . 
Log  Function  Log(b,x) calculates the logarithm base b of x. 
LogE  Function  LogE(x) calculates the natural (base e) logarithm of x. 
LowercaseASCII  Function  Converts the uppercase letters from "A" to "Z" in a string to lowercase. 
Maximum  Function  Maximum(a,b,c,...) returns the maximum value. 
Minimum  Function  Minimum(a,b,c,...) returns the minimum value. 
NewLine  Constant  For Windows targets, newline is a carriage return character followed by a linefeed character. For nonWindows targets, newline is just a linefeed character. 
Number  Function  Converts an object (such as a string) to a number or returns an error if the object doesn't represent a valid number. 
Pi  Constant  The ratio of a circle's circumference to its diameter: 3.141... . 
Quotient  Function  Quotient(x,y) returns the quotient of x divided by y. 
Read  Procedure  Read reads all of the data from standard input and assigns it to a variable. If standard input is the command line, Read is the same as ReadLine. 
ReadLine  Procedure  ReadLine reads a line of data from standard input and assigns it to a variable. 
RealApproximationMode  Variable  Sets the approximation mode to use for real arithmetic if a result can't be represented exactly in the requested number of digits (see "RealDecimalDigits"). The default is RoundToEven. The 12 possible values are: RoundToEven (probably the best for most applications), RoundToOdd, RoundAwayFromZero ("schoolbook rounding"), RoundTowardZero, RoundTowardPositiveInfinity, RoundTowardNegativeInfinity, TruncateToEven, TruncateToOdd, TruncateAwayFromZero, TruncateTowardZero, TruncateTowardPositiveInfinity, TruncateTowardNegativeInfinity. To change it, for example: Set RealApproximationMode To TruncateTowardNegativeInfinity. 
RealDecimalDigits  Variable  Sets the numbers of decimal digits of precision for real arithmetic. The default is 30. To change it to 50, for example: Set RealDecimalDigits To 50. 
Remainder  Function  Remainder(x,y) returns the remainder of x divided by y. 
RequestedToStop  Function  This function returns True if the user has pressed the Esc key or if the program has been requested to stop by some other program on your computer. 
RoundAwayFromZero  Constant  See "RealApproximationMode". This approximation mode is also known as "schoolbook rounding". If a real result is exactly halfway between two representable reals, it will be set to the real furthest from zero. Examples: 1.65 rounds to 1.7, 1.65 rounds to 1.7 
RoundToEven  Constant  See "RealApproximationMode". This is probably the best approximation mode for most applications using numbers in even bases. If a real result is exactly halfway between two representable reals, it will be set to the even real. Examples: 1.65 rounds to 1.6, 1.55 rounds to 1.6. 
RoundToOdd  Constant  See "RealApproximationMode". If a real result is exactly halfway between two representable reals, it will be set to the odd real. Examples: 1.65 rounds to 1.7, 1.55 rounds to 1.5. 
RoundTowardNegativeInfinity  Constant  See "RealApproximationMode". If a real result is exactly halfway between two representable reals, it will be rounded toward negative infinity. Examples: 1.65 rounds to 1.6, 1.65 rounds to 1.7. 
RoundTowardPositiveInfinity  Constant  See "RealApproximationMode". If a real result is exactly halfway between two representable reals, it will be rounded toward positive infinity. Examples: 1.65 rounds to 1.7, 1.65 rounds to 1.6. 
RoundTowardZero  Constant  See "RealApproximationMode". If a real result is exactly halfway between two representable reals, it will be rounded toward zero. Examples: 1.65 rounds to 1.6, 1.65 rounds to 1.6. 
Sec  Function  Secant. 
Sech  Function  Hyperbolic secant. 
SetFrameBackgroundRGB  Procedure  Sets all the pixels in the current animation frame to the requested color, erasing whatever was previously drawn. An R, G, or B value of 0 means none of that color should be mixed in; an RGB value of 1 means the maximum amount should be mixed in. 
Sin  Function  Sine. 
Sinh  Function  Hyperbolic sine. 
SquareRoot  Function  Square root. 
String  Function  Converts an object (such as a number) to a string. 
Substring  Function  Substring(string,position), Substring(string,position,length) returns a substring of string starting at the 1based position. If length is omitted, the substring is the remainder of the string. 
Tab  Constant  Tab character. 
Tan  Function  Tangent. 
Tanh  Function  Hyperbolic tangent. 
True  Constant  True. 
TruncateAwayFromZero  Constant  See "RealApproximationMode". If a real result is anywhere between two representable reals, it will be set to the real furthest from zero. Examples: 1.61 truncates to 1.7, 1.61 truncates to 1.7 
TruncateToEven  Constant  See "RealApproximationMode". If a real result is anywhere between two representable reals, it will be set to the even real. Examples: 1.69 truncates to 1.6, 1.51 truncates to 1.6. 
TruncateToOdd  Constant  See "RealApproximationMode". If a real result is anywhere between two representable reals, it will be set to the odd real. Examples: 1.61 truncates to 1.7, 1.59 truncates to 1.5. 
TruncateTowardNegativeInfinity  Constant  See "RealApproximationMode". If a real result is anywhere between two representable reals, it will be truncated toward negative infinity. Examples: 1.69 truncates to 1.6, 1.69 truncates to 1.7. 
TruncateTowardPositiveInfinity  Constant  See "RealApproximationMode". If a real result is anywhere between two representable reals, it will be truncated toward positive infinity. Examples: 1.61 truncates to 1.7, 1.69 truncates to 1.6. 
TruncateTowardZero  Constant  See "RealApproximationMode". If a real result is anywhere between two representable reals, it will be truncated toward zero. Examples: 1.69 truncates to 1.6, 1.69 truncates to 1.6. 
UppercaseASCII  Function  Converts the lowercase letters from "a" to "z" in a string to uppercase. 
Write  Procedure  Write writes 1 or more commaseparated expressions to standard output. 
WriteLine  Procedure  WriteLine writes 1 more more commaseparated expressions to standard output, followed by a newline. 


