A Float is an approximate numeric field that stores floating point numeric data (as opposed to fixed point like Signed and Packed). Floating point data is approximate. Not all values in the field type range can be precisely represented. Floats are classed as Numbers in LANSA.
Fields of type Float may only be used in an arithmetic expression. Floats cannot be displayed in a component or function.
A Float is defined by the number of bytes used to store the value. The higher number of bytes, the more accurate the number. A 4 byte Float is accurate while the number of digits is less than or equal to 6. An 8 byte Float is accurate while the number of digits is less than or equal to 15.
The following table provides the accurate length for each of the possible byte lengths for a Float. The accurate length may be considered equivalent to the actual length of a signed or packed field. The table also notes the possible number of decimal places at runtime.
| Accurate # digits (accurate length) | Possible decimal places |
|---|---|---|
4 | 6 | 0 - 6 |
8 | 15 | 0 - 15 |
Please review the general 1.1.1 Field Type Considerations.
Rules for defining a Float field in the repository are:
Length | Floats may be 4 or 8 bytes in length. Decimals must always be zero. |
|---|---|
Valid Keyboard Shift | Blanks |
Allowed Attributes | AB, ASQN, CS, FE, ND, RA, RB, RL, RLTB. |
Edit Mask | Not allowed. |
Default | *NULL |
Partition Type | |
|---|---|
Files | Floats may only be used in RDMLX Files. Floats may be used as real fields. Use of Floats as key fields is not recommended. |
Logical Views | Use of Floats as key fields is not recommended. |
Virtual Fields | Floats may only used with Mathematical Virtual Fields. Floats may be used as the source field(s). |
Predetermined Join Fields | Floats may be used for numeric predetermined joined fields. |
RDML Commands | Fields of type Float may only be used in an arithmetic expression. |
Built-In Functions | When used in Built-In Functions, floats are valid for arguments of type 'N'. |
Special Values | *NULL, *NAVAIL, *HIVAL, *LOVAL, *REMEMBERED_VALUE |
Conversion | It is wrong to convert Floats to/from Date and Time fields. Refer to Field Type Conversions. |
1.1.7 Packed
1.1.8 Signed
1.1.9 Integer