next up previous contents index
Next: 10.3 Words Up: 10. G Code Basics Previous: 10.1 Blocks   Contents   Index

10.2 Numbers

Since every nc word is composed of a letter and a value. Before we begin a serious discussion of the meaning of nc programming words we need to consider the meaning of value within the interpreter. A real_value is some collection of characters that can be processed to come up with a number. A real_value may be an explicit number (such as 341 or -0.8807), a parameter value, an expression, or a unary operation value. In this chapter all examples will use explicit numbers. Expressions and unary operations are treated in the computation chapter. The use of parameter values or variables are a described in detail in the Using Variables chapter.

EMC uses the following rules regarding numbers. In these rules a digit is a single character between 0 and 9.

A number consists of :

There are two kinds of numbers: integers and decimals. An integer does not have a decimal point in it; a decimal does.

Some additional rules about the meaning of numbers are that:

Numbers used for specific purposes in RS274/NGC are often restricted to some finite set of values or to some range of values. In many uses, decimal numbers must be close to integers; this includes the values of indexes (for parameters and changer slot numbers, for example). In the interpreter, a decimal number which is supposed be close to an integer is considered close enough if it is within 0.0001 of an integer.


next up previous contents index
Next: 10.3 Words Up: 10. G Code Basics Previous: 10.1 Blocks   Contents   Index
root 2003-05-26