-
Notifications
You must be signed in to change notification settings - Fork 0
How to Construct a Real Number
Any nonnegative integer can be constructed using the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, with any length of digits.
[integer]
Any leading zeros must be trimmed off, unless the value is 0 itself.
A plus-minus sign can be added. Positives can have a "+" or no sign, and negatives always have a "-".
±[integer]
Examples: -16, -3, 0, 1, 198, 87178291200
Any decimal from 0-1 can be constructed using a dot "." and some digits.
0.[decimal]
Leading zeros change the decimal, so they can stay. But trailing zeros must be trimmed off.
To generalize any terminating decimal, with any number of digits either side of the decimal point, we bring the sides together:
±[integer].[decimal]
Examples: -64000, -0.8625, 0.0000000001, 0.75, 1, 12.38, 12.5509, 198
Place values to the left are 10x greater than the previous one. Place values to the right are 10x less than the previous one.
What about repeating decimals, like 0.333333333333333...? We can optionally use fractions for them.
For a simplified mixed fraction: We use a and b, where a and b are integers, and b is not 0. a must be less than b for the fraction to be proper, and a and b are coprime when simplified.
±[integer] [a]/[b]
Examples: -3 14/15, 9/26, 53 5/8
Values like 53 5/8 can be converted to a decimal: 53.625
Integer: ±[integer]
Terminating Decimal: ±[integer].[decimal]
Repeating Decimal (Fraction): ±[integer] [a]/[b]
We only use one plus/minus sign on the left. A fraction like -3/-6 would complicate matters.
Some real numbers have no exact value, or fraction, or anything. Like √2 (1.41421356...) or π (3.14159265...)
So we're only able to round or truncate them to a certain number of decimal places.