Loading...
Searching...
No Matches
CxxTest::ValueTraits< const double > Class Reference

`#include <ValueTraits.h>`

## Public Member Functions

| ValueTraits (double t)
const char * | asString (void) const

## Private Types

enum | { MAX_DIGITS_ON_LEFT = 24 , DIGITS_ON_RIGHT = 4 , BASE = 10 }
enum |

## Private Member Functions

char * | doNegative (double &t)
void | hugeNumber (double t)
void | normalNumber (double t)
char * | doubleToString (double t, char *s, unsigned skip=0, unsigned max=(unsigned) -1)

## Static Private Member Functions

static unsigned | requiredDigitsOnLeft (double t)

## Private Attributes

char | _asString [1+MAX_DIGITS_ON_LEFT+1+DIGITS_ON_RIGHT+1]

## Detailed Description

Definition at line 310 of file ValueTraits.h.

## Member Enumeration Documentation

## anonymous enum

anonymous enum

private

Definition at line 76 of file ValueTraits.h.

{ MAX_BYTES = 8 };
CxxTest::ValueTraits< const double >::MAX_BYTES
@ MAX_BYTES
Definition ValueTraits.h:76

## anonymous enum

anonymous enum

private

Enumerator
MAX_DIGITS_ON_LEFT |
DIGITS_ON_RIGHT |
BASE |

Definition at line 323 of file ValueTraits.h.

{ MAX_DIGITS_ON_LEFT = 24, DIGITS_ON_RIGHT = 4, BASE = 10 };
CxxTest::ValueTraits< const double >::DIGITS_ON_RIGHT
@ DIGITS_ON_RIGHT
Definition ValueTraits.h:323
CxxTest::ValueTraits< const double >::MAX_DIGITS_ON_LEFT
@ MAX_DIGITS_ON_LEFT
Definition ValueTraits.h:323
CxxTest::ValueTraits< const double >::BASE
@ BASE
Definition ValueTraits.h:323

## Constructor & Destructor Documentation

## ValueTraits()

CxxTest::ValueTraits< const double >::ValueTraits | ( | double | t | ) |

inline

Definition at line 313 of file ValueTraits.h.

{
( requiredDigitsOnLeft( t ) > MAX_DIGITS_ON_LEFT ) ?
hugeNumber( t ) :
normalNumber( t );
}
CxxTest::ValueTraits< const double >::normalNumber
void normalNumber(double t)
CxxTest::ValueTraits< const double >::hugeNumber
void hugeNumber(double t)
CxxTest::ValueTraits< const double >::requiredDigitsOnLeft
static unsigned requiredDigitsOnLeft(double t)
CxxTest::ValueTraits
Definition ValueTraits.h:75

## Member Function Documentation

## asString()

const char * CxxTest::ValueTraits< const double >::asString | ( | void |  | ) | const

inline

Definition at line 320 of file ValueTraits.h.

{ return _asString; }
CxxTest::ValueTraits< const double >::_asString
char _asString[1+MAX_DIGITS_ON_LEFT+1+DIGITS_ON_RIGHT+1]
Definition ValueTraits.h:324

## doNegative()

char * CxxTest::ValueTraits< const double >::doNegative | ( | double & | t | ) |

private

## doubleToString()

char * CxxTest::ValueTraits< const double >::doubleToString | ( | double | t,
|  | char * | s,
|  | unsigned | skip = 0,
|  | unsigned | max = (unsigned) -1 )

private

## hugeNumber()

void CxxTest::ValueTraits< const double >::hugeNumber | ( | double | t | ) |

private

## normalNumber()

void CxxTest::ValueTraits< const double >::normalNumber | ( | double | t | ) |

private

## requiredDigitsOnLeft()

unsigned CxxTest::ValueTraits< const double >::requiredDigitsOnLeft | ( | double | t | ) |

static private

## Field Documentation

## _asString

char CxxTest::ValueTraits< const double >::_asString[1+MAX_DIGITS_ON_LEFT+1+DIGITS_ON_RIGHT+1]

private

Definition at line 324 of file ValueTraits.h.

The documentation for this class was generated from the following file:

- libpolys/tests/cxxtest/ValueTraits.h