Top
Back: for
Forward: importfrom
FastBack: Functions
FastForward: System variables
Up: Control structures
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

5.2.9 if

Syntax:
if ( boolean_expression ) true_block
if ( boolean_expression ) true_block else false_block
Purpose:
executes true_block if the boolean condition is true. If the if statement is followed by an else statement and the boolean condition is false, then false_block is executed.
Example:
 
int i = 9;
matrix m[i][i];
if (i > 5 and typeof(m) == "matrix")
{
  m[i][i] = i;
}
See Control structures; boolean expressions; break; else.

Top Back: for Forward: importfrom FastBack: Functions FastForward: System variables Up: Control structures Top: Singular Manual Contents: Table of Contents Index: Index About: About this document
            User manual for Singular version 4-0-3, 2016, generated by texi2html.