|
YSTest
PreAlpha_b400_20130424
The YSLib Test Project
|
通用定点数。 更多...
#include <rational.hpp>


Public 类型 | |
| typedef _tBase | base_type |
Public 成员函数 | |
| fixed_point () ynoexcept | |
| 无参数构造。 | |
| template<typename _tInt > | |
| fixed_point (_tInt val, typename std::enable_if< std::is_integral< _tInt >::value, int >::type=0) ynoexcept | |
| template<typename _tFloat > | |
| fixed_point (_tFloat val, typename std::enable_if< std::is_floating_point< _tFloat >::value, int >::type=0) ynoexcept | |
| fixed_point (const fixed_point &)=default | |
| template<size_t _vOtherInt, size_t _vOtherFrac> | |
| fixed_point (const fixed_point< base_type, _vOtherInt, _vOtherFrac > &f, typename std::enable_if<(_vOtherInt< int_bit_n), int >::type=0) ynoexcept | |
| template<size_t _vOtherInt, size_t _vOtherFrac> | |
| fixed_point (const fixed_point< base_type, _vOtherInt, _vOtherFrac > &f, typename std::enable_if<(int_bit_n< _vOtherInt), int >::type=0) ynoexcept | |
| bool | operator< (const fixed_point &f) const ynoexcept |
| bool | operator== (const fixed_point &f) const ynoexcept |
| bool | operator! () const ynoexcept |
| fixed_point | operator- () const ynoexcept |
| fixed_point & | operator++ () ynoexcept |
| fixed_point & | operator-- () ynoexcept |
| fixed_point & | operator+= (const fixed_point &f) ynoexcept |
| fixed_point & | operator-= (const fixed_point &f) ynoexcept |
| fixed_point & | operator*= (const fixed_point &f) ynoexcept |
| fixed_point & | operator/= (const fixed_point &f) ynoexcept |
| fixed_point & | operator>>= (size_t s) ynoexcept |
| fixed_point & | operator<<= (size_t s) ynoexcept |
| template<typename _type > | |
| operator _type () const | |
静态 Public 成员函数 | |
| static base_type | base_element () ynoexcept |
取 base_type 表达的单位元。 | |
| static fixed_point | identity () ynoexcept |
| 取单位元。 | |
静态 Public 属性 | |
| static const size_t | int_bit_n = _vInt |
| 整数部分二进制位数。 | |
| static const size_t | frac_bit_n = _vFrac |
| 小数部分二进制位数。 | |
| static const size_t | digit_bit_n = int_bit_n + frac_bit_n |
| 非符号位的二进制位数。 | |
Private 类型 | |
| typedef empty_base< fixed_point > | internal_construct_tag |
| 内部构造类型( private 构造重载用)。 | |
Private 成员函数 | |
| fixed_point (base_type v, internal_construct_tag) ynoexcept | |
| template<typename _type > | |
| std::enable_if < std::is_integral< _type > ::value, _type >::type | cast () const |
| template<typename _type > | |
| std::enable_if < std::is_floating_point < _type >::value, _type > ::type | cast () const |
Private 属性 | |
| base_type | value |
友元 | |
| template<typename _OtherBase , size_t _vOtherInt, size_t _vOtherFrac> | |
| class | fixed_point |
| class | std::numeric_limits< fixed_point< _tBase, _vInt, _vFrac > > |
| fixed_point | fabs (fixed_point x) |
| fixed_point | ceil (fixed_point x) |
| fixed_point | floor (fixed_point x) |
| fixed_point | round (fixed_point x) |
通用定点数。
基于整数算术实现的确定有限精度二进制定点小数类型。可用于替换内建的浮点数类型。 是否有符号同基本整数类型参数。若有符号,则最高有效位为符号位。 逻辑布局: [符号位]|整数部分|小数部分 。各个部分的内部为补码表示。
| _tBase | 基本整数类型。 |
| _vInt | 整数部分(若有符号则不包括符号位,下同)二进制位数。 |
| _vFrac | 分数部分二进制位数。 |
在文件 rational.hpp 第 100 行定义.
| typedef _tBase ystdex::fixed_point< _tBase, _vInt, _vFrac >::base_type |
在文件 rational.hpp 第 116 行定义.
|
private |
内部构造类型( private 构造重载用)。
在文件 rational.hpp 第 127 行定义.
|
inline |
|
inlineprivate |
在文件 rational.hpp 第 141 行定义.
|
inline |
在文件 rational.hpp 第 147 行定义.
|
inline |
在文件 rational.hpp 第 152 行定义.
|
inlinedefault |
|
inline |
在文件 rational.hpp 第 161 行定义.
|
inline |
在文件 rational.hpp 第 167 行定义.
|
inlinestatic |
取 base_type 表达的单位元。
取值等于 1 的元素,使用 base_type 表达。
在文件 rational.hpp 第 284 行定义.
参考自 ystdex::fixed_point< u16, 9 >::operator+=() , 以及 ystdex::fixed_point< u16, 9 >::operator-=().

|
inlineprivate |
在文件 rational.hpp 第 265 行定义.
|
inlineprivate |
在文件 rational.hpp 第 272 行定义.
|
inlinestatic |
|
inline |
在文件 rational.hpp 第 256 行定义.
|
inline |
在文件 rational.hpp 第 183 行定义.
|
inline |
在文件 rational.hpp 第 220 行定义.
|
inline |
在文件 rational.hpp 第 196 行定义.
|
inline |
在文件 rational.hpp 第 208 行定义.
|
inline |
在文件 rational.hpp 第 188 行定义.
|
inline |
在文件 rational.hpp 第 202 行定义.
|
inline |
在文件 rational.hpp 第 214 行定义.
|
inline |
在文件 rational.hpp 第 236 行定义.
|
inline |
在文件 rational.hpp 第 173 行定义.
|
inline |
在文件 rational.hpp 第 249 行定义.
|
inline |
在文件 rational.hpp 第 178 行定义.
|
inline |
在文件 rational.hpp 第 243 行定义.
|
friend |
在文件 rational.hpp 第 305 行定义.
|
friend |
在文件 rational.hpp 第 299 行定义.
|
friend |
在文件 rational.hpp 第 105 行定义.
|
friend |
在文件 rational.hpp 第 312 行定义.
|
friend |
在文件 rational.hpp 第 319 行定义.
|
friend |
在文件 rational.hpp 第 113 行定义.
|
static |
非符号位的二进制位数。
在文件 rational.hpp 第 123 行定义.
|
static |
小数部分二进制位数。
在文件 rational.hpp 第 121 行定义.
参考自 ystdex::fixed_point< u16, 9 >::base_element() , 以及 ystdex::fixed_point< u16, 9 >::operator/=().
|
static |
整数部分二进制位数。
在文件 rational.hpp 第 119 行定义.
|
private |
在文件 rational.hpp 第 129 行定义.
参考自 ystdex::fixed_point< u16, 9 >::base_element(),ystdex::fixed_point< u16, 9 >::cast(),ystdex::fixed_point< u16, 9 >::operator*=(),ystdex::fixed_point< u16, 9 >::operator+=(),ystdex::fixed_point< u16, 9 >::operator-=(),ystdex::fixed_point< u16, 9 >::operator/=() , 以及 ystdex::fixed_point< u16, 9 >::operator==().