Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Double Class Reference

Inheritance diagram for Double:

Number List of all members.

Public Types

typedef double tValue

Private Types

enum  Radix { Binary = 2, Octal = 8, Decimal = 10, Hexadecimal = 16 }

Static Private Member Functions

tValue pow10 (uint exp)
tValue parse (tChar[] src, uint *ate=null)
tChar[] format (tChar[] dst, tValue x, uint decimals=6, bool scientific=false)
 this ()
package uint trim (tChar[] digits, inout bool sign, Radix *radix=null)

Detailed Description

A set of functions for converting between string and numeric values.

Used by modules Token and DisplayWriter

Definition at line 56 of file Double.d.


Member Typedef Documentation

typedef double tValue
 

Definition at line 58 of file Double.d.

Referenced by format(), parse(), and pow10().


Member Enumeration Documentation

enum Radix [inherited]
 

Enumeration values:
Binary 
Octal 
Decimal 
Hexadecimal 

Definition at line 51 of file Number.d.


Member Function Documentation

tValue pow10 uint  exp  )  [inline, static, private]
 

Definition at line 64 of file Double.d.

References assert(), and tValue.

Referenced by parse().

tValue parse tChar[]  src,
uint *  ate = null
[inline, static, private]
 

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.

Definition at line 101 of file Double.d.

References len, memicmp(), pow10(), Number::trim(), and tValue.

tChar [] format tChar[]  dst,
tValue  x,
uint  decimals = 6,
bool  scientific = false
[inline, static, private]
 

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 184 of file Double.d.

References assert(), and tValue.

this  )  [inline, static, inherited]
 

Definition at line 61 of file Number.d.

References Number::error.

package uint trim tChar[]  digits,
inout bool  sign,
Radix radix = null
[inline, static, inherited]
 

Definition at line 70 of file Number.d.

References len.

Referenced by Long::parse(), Int::parse(), and parse().


The documentation for this class was generated from the following file:
Generated on Sun Mar 6 00:31:07 2005 for Mango by doxygen 1.3.6