Scalar variables do not need to be declared, and are type assigned when an assignment is first made. Any unquoted number representation in integer, floating point, or exponential notation is taken as a scalar constant. Character constants enclosed in single quotes (as in C) are accepted, with the value being the ASCII character code. There is a ToChar function which converts ASCII codes to a string representation for printing. Also accepted are hexadecimal integer constants in the form
0xhex_numberFor example, 0x0, 0x2a, and 0xffff003b are all valid constants.
In addition to the standard floating-point formats, numbers can be represented using SPICE multiplier suffixes. These are alphabetic characters and sequences shown in the table below, which appear immediately following a fixed-point number or integer. The suffix is case-insensitive. For example, the following tokens all represent the same number: 1000, 1e3, 1k. Likewise: 0.0001234, 1.234e-4, 123.4u.
suffix | multiplier | name |
---|---|---|
a | 1e-18 | atto |
f | 1e-15 | femto |
p | 1e-12 | pico |
n | 1e-9 | nano |
u | 1e-6 | micro |
m | 1e-3 | milli |
mil | 25.4 | mil |
k | 1e3 | kilo |
meg | 1e6 | mega |
g | 1e9 | giga |
t | 1e12 | tera |