Presentations
XFP = (-1)s × bexp-bias × m
Computer/system | Width (b) | Base | Exponent (b) | Mantissa (b) |
---|---|---|---|---|
IEEE 754 half | 16 | 2 | 5 | 10+1 |
IEEE 754 single | 32 | 2 | 8 | 23+1 |
IEEE 754 double | 64 | 2 | 11 | 52+1 |
IEEE 754 double extended | 80 | 2 | 15 | 64 |
IEEE 754 quadruple | 128 | 2 | 15 | 112+1 |
IEEE 754 octuple | 256 | 2 | 19 | 236+1 |
IBM 7xx series | 36 | 2 | 8 | 27 |
IBM 360 single | 32 | 16 | 7 | 24 |
IBM 360 double | 64 | 16 | 7 | 56 |
HP 3000 single | 32 | 2 | 9 | 22 |
HP 3000 double | 64 | 2 | 9 | 54 |
CDC 6000, 6600 | 60 | 2 | 11 | 48+1 |
Cray-1</a> | 64 | 2 | 15 | 48 |
Strela</a> | 43 | 2 | 7 | 35 |
Apple II | 40 | 2 | 8 | 31+1 |
ZX Spectrum | 40 | 2 | 8 | 31+1 |
Atari (FP rutiny) | 48 | 10 | 7 | 40 |
Turbo Pascal real | 48 | 2 | 8 | 39 |
Oficial name | Basic (must be supported) | a.k.a. | Sign | Exponent | Mantissa | Sum (bits) | Decimal numbers |
---|---|---|---|---|---|---|---|
binary16 | × | half precision | 1b | 5b | 10b | 16b | cca 3,3 |
binary32 | ✓ | single precision/float | 1b | 8b | 23b | 32b | cca 7,2 |
binary64 | ✓ | double precision | 1b | 11b | 52b | 64b | cca 15,9 |
binary128 | ✓ | quadruple precision | 1b | 15b | 112b | 128b | cca 34,0 |
binary256 | × | octuple precision | 1b | 19b | 236b | 256b | cca 71,3 |
step = 0.1
x = 0.0
while x!= 1.0:
x += step
print(x)
package main
import "fmt"
func main() {
step := 0.1
x := 0.0
for x != 1.0 {
x += step
fmt.Printf("%f\n", x)
}
}
Equality Is it true?
x == (int)(float) x yes/no
x == (int)(double) x yes/no
f == (float)(double) f yes/no
d == (float) d yes/no
f == -(-f); yes/no
2/3 == 2/3.0 yes/no
d < 0.0 ⇒ ((d*2) < 0.0) yes/no
d > f ⇒ -f > -d yes/no
d * d >= 0.0 yes/no
(d+f)-d == f yes/no
(x+y)-y == x yes/no
(x-y)+y == x yes/no