O'Reilly logo

DarkBASIC Pro Game Programming, Second Edition by Joshua R. Smith, Jonathan S. Harbour

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Mathematical Operators

DarkBASIC provides a good assortment of mathematical operators that you can use in your programs. These operators are built into the language. The basic math operations for performing addition, subtraction, multiplication, and division, as well as working with exponents, are a common feature of all programming languages, so you can use what you learn in DarkBASIC with other languages as well.

Addition

The plus sign is used to add numbers (integers or decimals) from one or more variables, including variable assignment and formulas used in branching statements. Addition is commonly used to increment the value of a counter variable. For example:

REM Initialize the variable Number AS INTEGER = 0 REM Increment the variable ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required