TNB Library
|
分数管理. [詳解]
#include <TnbFraction.h>
公開メンバ関数 | |
CFractionT (TYP num, TYP den) | |
コンストラクタ [詳解] | |
virtual INT_PTR | Compare (const CFractionT &t) const |
[確認] 比較 [詳解] | |
virtual INT_PTR | Compare (const CFractionT< int > &t) const=0 |
[確認] 比較 [詳解] | |
double | Get (void) const |
[取得] 実数取得. [詳解] | |
TYP | GetDenominator (void) const |
[取得] 分母取得. [詳解] | |
TYP | GetNumerator (void) const |
[取得] 分子取得. [詳解] | |
virtual bool | IsEqual (const CFractionT< int > &t) const |
[確認] 比較 [詳解] | |
CFractionT & | LeastCommonDivisor (void) |
[変換] 最小公倍. [詳解] | |
bool | operator!= (const CFractionT< int > &t) const |
[確認] 比較 [詳解] | |
CFractionT | operator* (const CFractionT &other) const |
[計算] 乗算. [詳解] | |
CFractionT | operator* (TYP val) const |
[計算] 乗算. [詳解] | |
CFractionT & | operator*= (const CFractionT &other) |
[代入] 乗算代入. [詳解] | |
CFractionT & | operator*= (TYP val) |
[代入] 乗算代入. [詳解] | |
CFractionT | operator+ (const CFractionT &other) const |
[計算] 加算. [詳解] | |
CFractionT & | operator+= (const CFractionT &other) |
[代入] 加算代入. [詳解] | |
CFractionT | operator- (const CFractionT &other) const |
[計算] 減算. [詳解] | |
INT_PTR | operator- (const CFractionT< int > &t) const |
[確認] 比較 [詳解] | |
CFractionT & | operator- (void) |
[設定] マイナス化. [詳解] | |
CFractionT & | operator-= (const CFractionT &other) |
[代入] 減算代入. [詳解] | |
CFractionT | operator/ (const CFractionT &other) const |
[計算] 除算. [詳解] | |
CFractionT | operator/ (TYP val) const |
[計算] 除算. [詳解] | |
CFractionT & | operator/= (const CFractionT &other) |
[代入] 除算代入. [詳解] | |
CFractionT & | operator/= (TYP val) |
[代入] 除算代入. [詳解] | |
bool | operator< (const CFractionT< int > &t) const |
[確認] 比較 [詳解] | |
bool | operator<= (const CFractionT< int > &t) const |
[確認] 比較 [詳解] | |
CFractionT & | operator= (const CFractionT &other) |
[代入] 代入. [詳解] | |
bool | operator== (const CFractionT< int > &t) const |
[確認] 比較 [詳解] | |
bool | operator> (const CFractionT< int > &t) const |
[確認] 比較 [詳解] | |
bool | operator>= (const CFractionT< int > &t) const |
[確認] 比較 [詳解] | |
void | Set (TYP num, TYP den) |
[設定] 値設定. [詳解] | |
分数管理.
分母と分子の2つの値で分数を管理します。 四則演算にも対応しています。
TYP | 要素の型。 |
TnbFraction.h の 33 行目に定義があります。
CFractionT | ( | TYP | num, |
TYP | den | ||
) |
|
virtual |
|
pure virtualinherited |
[確認] 比較
t | 比較対象 |
0 | 自分は t と同じ |
1以上 | 自分は t より大きい |
0未満 | 自分は t より小さい |
double Get | ( | void | ) | const |
TYP GetDenominator | ( | void | ) | const |
TYP GetNumerator | ( | void | ) | const |
|
virtualinherited |
CFractionT & LeastCommonDivisor | ( | void | ) |
|
inherited |
CFractionT operator* | ( | const CFractionT< TYP > & | other | ) | const |
CFractionT operator* | ( | TYP | val | ) | const |
CFractionT & operator*= | ( | const CFractionT< TYP > & | other | ) |
CFractionT & operator*= | ( | TYP | val | ) |
CFractionT operator+ | ( | const CFractionT< TYP > & | other | ) | const |
CFractionT & operator+= | ( | const CFractionT< TYP > & | other | ) |
CFractionT operator- | ( | const CFractionT< TYP > & | other | ) | const |
|
inherited |
CFractionT & operator- | ( | void | ) |
CFractionT & operator-= | ( | const CFractionT< TYP > & | other | ) |
CFractionT operator/ | ( | const CFractionT< TYP > & | other | ) | const |
CFractionT operator/ | ( | TYP | val | ) | const |
CFractionT & operator/= | ( | const CFractionT< TYP > & | other | ) |
CFractionT & operator/= | ( | TYP | val | ) |
|
inherited |
|
inherited |
CFractionT & operator= | ( | const CFractionT< TYP > & | other | ) |
|
inherited |
|
inherited |
|
inherited |
void Set | ( | TYP | num, |
TYP | den | ||
) |