Inheritance diagram for Double:
Public Types | |
typedef double | tValue |
Private Types | |
enum | Flags { Fill = 1, Left = Fill << 1, Prec = Left << 1, Hash = Prec << 1, Space = Hash << 1, Zero = Space << 1, Sign = Zero << 1, Comma = Sign << 1, Plus = Comma << 1, Array = Plus << 1 } |
Static Private Member Functions | |
static tValue | pow10 (uint exp) |
static tValue | parse (char[] src, uint *ate=null) |
static int | format (double i, inout Style style) |
static char[] | format (char[] dst, tValue x, uint decimals=6, bool scientific=false) |
static void | error (char[] msg) |
While these functions are all static, they are encapsulated within a class inheritance to preserve some namespace cohesion. One might use structs for encapsualtion instead, but then inheritance would be lost. Note that the root class, Styled, is abstract to prevent accidental instantiation of these classes.
Definition at line 67 of file Double.d.
|
|
|
Declare stylistic flags |
|
Internal function to convert an exponent specifier to a floating point value. Definition at line 78 of file Double.d. References assert(). Referenced by parse(). |
|
Convert a formatted string of digits to a floating- point number. Good for general use, but use David Gay's dtoa package if serious rounding adjustments should be applied. |
|
Convert float to string based upon Style bits. Definition at line 192 of file Double.d. References format(). Referenced by format(). |
|
Convert a float to a string. This produces pretty good results for the most part, though one should use David Gay's dtoa package for best accuracy. Note that the approach first normalizes a base10 mantissa, then pulls digits from the left side whilst emitting them (rightward) to the output. Definition at line 212 of file Double.d. References assert(). |
|
Throw an exception with the provided messsage Definition at line 338 of file Styled.d. Referenced by Number::format(), Format::print(), and Format::Sprintf::utf8(). |