zheng li wrote:it seems that java stores floating-point types in IEEE 754 format, but does some kind of rounding off when using them.
zheng li wrote:does anyone know why java deals with double this way?
zheng li wrote:is there any specification about it?
How many digits must be printed for the fractional part of m or a? There must be at least one digit to represent the fractional part, and beyond that as many, but only as many, more digits as are needed to uniquely distinguish the argument value from adjacent values of type double.
The width is the minimum number of characters to be written to the output. If the length of the converted value is less than the width then the output will be padded by ' ' (\u0020') until the total number of characters equals the width. The padding is on the left by default. If the '-' flag is given, then the padding will be on the right.