#include <fraction.h>
Public Types | |
| enum | ostream_fmt { sparse, verbose } |
Public Member Functions | |
| fraction () | |
| fraction (int64_t n) | |
| fraction (int64_t n, int64_t d) | |
| int64_t | getNumer () const |
| int64_t | getDenom () const |
| int64_t | getI () const |
| double | getD () const |
| int64_t | getInterimMultOverflowPt () const |
| int64_t | getFinalMultOverflowPt () const |
| int64_t | multReturnInt64 (int64_t b) const |
| fraction | reciprocal () const |
| void | setNumer (int64_t n) |
| void | setDenom (int64_t d) |
| void | set (int64_t n, int64_t d) |
| void | calcOverflowPts () const |
| void | reduce () const |
Static Public Attributes | |
| static ostream_fmt | curFmt = sparse |
Private Member Functions | |
| int64_t | multNoInterimOverflow (int64_t b) const |
| void | setRaw (int64_t n, int64_t d) |
Private Attributes | |
| int64_t | numer |
| int64_t | denom |
| int64_t | interimMultOverflowPt |
| int64_t | finalMultOverflowPt |
Definition at line 44 of file fraction.h.
Definition at line 54 of file fraction.h.
| fraction::fraction | ( | ) | [inline] |
Definition at line 57 of file fraction.h.
| fraction::fraction | ( | int64_t | n | ) | [inline, explicit] |
Definition at line 59 of file fraction.h.
Definition at line 62 of file fraction.h.
| void fraction::calcOverflowPts | ( | ) | const |
Definition at line 113 of file fraction.C.
References finalMultOverflowPt, getD(), getDenom(), getNumer(), I64_MAX, interimMultOverflowPt, multNoInterimOverflow(), and setRaw().
Referenced by reduce().
| double fraction::getD | ( | ) | const [inline] |
Definition at line 75 of file fraction.h.
Referenced by calcOverflowPts(), and operator*().
| int64_t fraction::getDenom | ( | ) | const [inline] |
Definition at line 69 of file fraction.h.
Referenced by calcOverflowPts(), multReturnInt64(), operator!=(), operator*(), operator/(), operator<(), operator<<(), operator==(), and operator>().
| int64_t fraction::getFinalMultOverflowPt | ( | ) | const [inline] |
Definition at line 79 of file fraction.h.
Referenced by multReturnInt64(), operator*(), and operator<<().
| int64_t fraction::getI | ( | ) | const [inline] |
Definition at line 71 of file fraction.h.
Referenced by multReturnInt64().
| int64_t fraction::getInterimMultOverflowPt | ( | ) | const [inline] |
Definition at line 76 of file fraction.h.
Referenced by multReturnInt64(), operator*(), and operator<<().
| int64_t fraction::getNumer | ( | ) | const [inline] |
Definition at line 68 of file fraction.h.
Referenced by timeBase::b1970Help(), calcOverflowPts(), timeUnit::dayHelp(), timeUnit::hourHelp(), timeUnit::leapYearHelp(), timeUnit::minHelp(), multReturnInt64(), operator!=(), operator*(), operator/(), operator<(), operator<<(), operator==(), operator>(), and timeUnit::yearHelp().
Definition at line 96 of file fraction.h.
Referenced by calcOverflowPts(), and multReturnInt64().
Definition at line 97 of file fraction.C.
References getDenom(), getFinalMultOverflowPt(), getI(), getInterimMultOverflowPt(), getNumer(), I64_MAX, and multNoInterimOverflow().
Referenced by timeUnit::cvtFrom_nsI(), and timeUnit::cvtTo_ns().
| fraction fraction::reciprocal | ( | ) | const [inline] |
Definition at line 92 of file fraction.h.
Referenced by timeUnit::set_ns_per_unit().
| void fraction::reduce | ( | ) | const [inline] |
Definition at line 143 of file fraction.h.
References calcOverflowPts(), denom, gcd(), and numer.
Referenced by operator!=(), operator==(), and timeUnit::timeUnit().
Definition at line 118 of file fraction.h.
| void fraction::setDenom | ( | int64_t | d | ) | [inline] |
Definition at line 108 of file fraction.h.
| void fraction::setNumer | ( | int64_t | n | ) | [inline] |
Definition at line 104 of file fraction.h.
Definition at line 113 of file fraction.h.
Referenced by calcOverflowPts().
fraction::ostream_fmt fraction::curFmt = sparse [static] |
Definition at line 55 of file fraction.h.
Referenced by operator<<().
int64_t fraction::denom [mutable, private] |
Definition at line 46 of file fraction.h.
Referenced by reduce().
int64_t fraction::finalMultOverflowPt [mutable, private] |
Definition at line 52 of file fraction.h.
Referenced by calcOverflowPts().
int64_t fraction::interimMultOverflowPt [mutable, private] |
Definition at line 49 of file fraction.h.
Referenced by calcOverflowPts().
int64_t fraction::numer [mutable, private] |
Definition at line 45 of file fraction.h.
Referenced by reduce().
1.6.1