Learn in the textbookData Types
DefinitionThe real type (実数型) is a data type for numbers that can have digits after the decimal point.
ExplanationIt is used for values with fractions, such as lengths, averages and ratios. Inside the computer it is usually stored as a floating-point number, so a value like 0.1 that has no exact binary form carries a tiny error.
AnalogyIt is like reading a length that falls between the marks on a ruler. The reading may still be off by a very small amount.
Memory hook"Floating" in floating-point refers to the decimal point moving its position to fit the size of the number.