|
|
Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
Page 3 of 5
| Value | Float bits (sign exponent mantissa) | Unbiased exponent |
|---|---|---|
| Largest positive (finite) float | 0 11111110 11111111111111111111111 | 128 |
| Largest negative (finite) float | 1 11111110 11111111111111111111111 | 128 |
| Smallest normalized float | 1 00000001 00000000000000000000000 | -125 |
| Pi | 0 10000000 10010010000111111011011 | 2 |
An exponent of all zeros indicates the mantissa is denormalized, which means the unstated leading bit is a zero instead of a one. The power of two in this case is the same as the lowest power of two available to a normalized mantissa. For the float, this is -125. This means that normalized mantissas multiplied by two raised to the power of -125 have an exponent field of 00000001, while denormalized mantissas multiplied by two raised to the power of -125 have an exponent field of 00000000. The allowance for denormalized numbers at the bottom end of the range of exponents supports gradual underflow. If the lowest exponent was instead used to represent a normalized number, underflow to zero would occur for larger numbers. In other words, leaving the lowest exponent for denormalized numbers allows smaller numbers to be represented. The smaller denormalized numbers have fewer bits of precision than normalized numbers, but this is preferable to underflowing to zero as soon as the exponent reaches its minimum normalized value.
| Value | Float bits (sign exponent mantissa) |
|---|---|
| Smallest positive (non-zero) float | 0 00000000 00000000000000000000001 |
| Smallest negative (non-zero) float | 1 00000000 00000000000000000000001 |
| Largest denormalized float | 1 00000000 11111111111111111111111 |
| Positive zero | 0 00000000 00000000000000000000000 |
| Negative zero | 1 00000000 00000000000000000000000 |
A Java float reveals its inner nature The applet below lets you play around with the floating-point format. The value of a float is displayed in several formats. The radix two scientific notation format shows the mantissa and exponent in base ten. Before being displayed, the actual mantissa is multiplied by 2 24, which yields an integral number, and the unbiased exponent is decremented by 24. Both the integral mantissa and exponent are then easily converted to base ten and displayed.
Click here for the source code of Exposed Float.
| Opcode | Operand(s) | Description |
|---|---|---|
| fadd | (none) | pops two floats, adds them, and pushes the float result |
| dadd | (none) | pops two doubles, adds them, and pushes the double result |
Subtraction is performed on floats and doubles via the following opcodes. Each opcode causes the top two values of the appropriate type to be popped off the stack. The topmost value is subtracted from the value just beneath the topmost value. The result is pushed back onto the stack. No exceptions are thrown by either of these opcodes.