122-32000 Parallax Inc, 122-32000 Datasheet - Page 216

MANUAL PROPELLER

122-32000

Manufacturer Part Number
122-32000
Description
MANUAL PROPELLER
Manufacturer
Parallax Inc
Datasheets

Specifications of 122-32000

Accessory Type
Manual
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
Propeller Education (PE) Kit
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
FLOAT
Convert an integer constant expression to a compile-time floating-point value.
((CON ┆ VAR ┆ OBJ ┆ PUB ┆ PRI ┆ DAT))
Returns: Resolved value of integer constant expression as a floating-point number.
Explanation
FLOAT
expressions. The
point value.
Using FLOAT
While most constants are 32-bit integer values, the Propeller compiler supports 32-bit
floating-point values and constant expressions for compile-time use. Note that this is for
constant expressions only, not run-time variable expressions.
For typical floating-point constant declarations, the expression must be shown as a floating-
point value in one of three ways: 1) as an integer value followed by a decimal point and at
least one digit, 2) as an integer with an E followed by an exponent value, or 3) both 1 and 2.
For example:
The above code creates three floating-point constants.
to 0.4 and
Notice that in the above example, every component of every expression is shown as a
floating-point value. Now take a look at the following example:
Page 216 · Propeller Manual v1.0
FLOAT
CON
CON
OneHalf = 0.5
Ratio
Miles
Two
Ratio
is one of three directives (
IntegerConstant
floating-point value.
(IntegerConstant )
Miles
– Spin Language Reference
= 2.0 / 5.0
= 10e5
= 2
= Two / 5.0
is equal to 1,000,000.
FLOAT
is the desired integer constant expression to be used as a constant
directive converts a constant integer value to a constant floating-
FLOAT
,
ROUND
and
TRUNC
OneHalf
) used for floating-point constant
is equal to 0.5,
Ratio
is equal

Related parts for 122-32000