Industrial Engineer · phase 4 of 16
REAL / Float
Floating-point data type used for fractional values and wide numeric ranges.
The Explain card
- Plain English
- A REAL is a floating point number, one that can carry a fraction and a very wide range. Temperatures, flow rates and scaled engineering values usually live in one.
- Example
- A tank level of twelve and three quarter feet or a flow of four thousandths of a gallon per second both fit in a REAL. An INT could hold neither without scaling tricks.
- Why it matters
- Floats are approximate, so two values that should be equal can differ in the seventh decimal place and a compare for equality fails forever. Use greater than or less than with a small band, and keep money and counts in integers.
- Hook
- Close enough, and never exactly.
Word knowledge
How the word is built, where it came from, and what it sits beside in memory.
In a sentence
The PLC stores the scaled pressure transmitter reading in REAL before the PID block calculates its output.
Letter by letter
- REAL real A whole-word keyword, not a letter-by-letter expansion
Where it came from
- Origin
- English real, ultimately from Latin realis, adopted as a programming-language keyword
- Entered the language
- 1950s
- What changed
- The word moved from general and mathematical use into programming terminology, then into IEC 61131-3 type naming.
How it is spelled
- Capitalisation
- Written REAL in IEC notation, including mid-sentence, although some programming environments accept lowercase.
- Plural and possessive
- Usually unchanged as a keyword; as a count noun, REALs, REAL's, and REALs'.
- Out loud
- Said as a word, not spelled out.
Same family
- LREAL
- INT
- DINT
Broken into chunks
-
real
- reality
- realism
Where it sits in the deck
Phase 4: PLC Memory, Tags, and Instructions
The data a program moves and the instructions that move it, from a single true or false value up to a structured array.