YSTest  PreAlpha_b500_20140530
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
rational.hpp 文件参考

有理数运算。 更多...

#include "cstdint.hpp"
#include "operators.hpp"
#include <cmath>
rational.hpp 的引用(Include)关系图:
此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

struct  ystdex::normalized_max< _type, _vNum, _vDen, _bIsFloat >
 取算术类型的正规化后的最大值。 更多...
 
struct  ystdex::normalized_max< _type, _vNum, _vDen, true >
 
struct  ystdex::normalized_max< _type, _vNum, _vDen, false >
 
struct  ystdex::is_normalizable< _type >
 判断类型是否可满足归一化要求。 更多...
 
struct  ystdex::is_normalizable< bool >
 
struct  ystdex::fixed_multiplicative< _type >
 定点数乘除法中间类型。 更多...
 
struct  ystdex::fixed_multiplicative< std::int64_t >
 
struct  ystdex::fixed_multiplicative< std::uint64_t >
 
class  ystdex::fixed_point< _tBase, _vInt, _vFrac >
 通用定点数。 更多...
 
struct  ystdex::modular_arithmetic< fixed_point< _tBase, _vInt, _vFrac > >
 modular_arithmeticfixed_point 特化类型。 更多...
 
struct  ystdex::is_normalizable< fixed_point< _tBase, _vInt, _vFrac > >
 is_normalizablefixed_point 特化类型。 更多...
 
struct  std::common_type< ystdex::fixed_point< _tBase1, _vInt1, _vFrac1 >, ystdex::fixed_point< _tBase2, _vInt2, _vFrac2 > >
 std::common_type 的 ystdex::fixed_point 特化类型。 更多...
 
class  std::numeric_limits< ystdex::fixed_point< _tBase, _vInt, _vFrac > >
 std::numeric_traits 的 ystdex::fixed_point 特化类型。 更多...
 

命名空间

 ystdex
 
 std
 

宏定义

#define YB_FIX_POINT_TMPL_HEAD_2
 
#define YB_FIX_POINT_TMPL_OP_2_PARAMS_BODY(_op)
 
#define YB_FIX_POINT_ARITHMETIC_2(_op)
 不同模板参数的二元算术操作符。 更多...
 
#define YB_FIX_POINT_RATIONAL_2(_op)
 不同模板参数的二元关系操作符。 更多...
 

详细描述

有理数运算。

版本
r1498
作者
FrankHB frank.nosp@m.hb19.nosp@m.89@gm.nosp@m.ail..nosp@m.com
自从
build 260
创建时间:
2011-11-12 23:23:47 +0800
修改时间:
2013-12-22 20:42 +0805
文本编码:
UTF-8
模块名称:
YStandardEx::Rational

在文件 rational.hpp 中定义.

宏定义说明

#define YB_FIX_POINT_ARITHMETIC_2 (   _op)
值:
yconstfn common_type_t<fixed_point<_tBase1, _vInt1, _vFrac1>, \
fixed_point<_tBase2, _vInt2, _vFrac2>> \
#define YB_FIX_POINT_TMPL_OP_2_PARAMS_BODY(_op)
Definition: rational.hpp:438
#define yconstfn
指定编译时常量函数。
Definition: ydef.h:463

不同模板参数的二元算术操作符。

自从
build 439
build 440

在文件 rational.hpp455 行定义.

#define YB_FIX_POINT_RATIONAL_2 (   _op)
值:
#define YB_FIX_POINT_TMPL_OP_2_PARAMS_BODY(_op)
Definition: rational.hpp:438
#define yconstfn
指定编译时常量函数。
Definition: ydef.h:463

不同模板参数的二元关系操作符。

自从
build 440
build 440

在文件 rational.hpp476 行定义.

#define YB_FIX_POINT_TMPL_HEAD_2
值:
template<typename _tBase1, size_t _vInt1, size_t _vFrac1, \
typename _tBase2, size_t _vInt2, size_t _vFrac2>
自从
build 440

在文件 rational.hpp434 行定义.

#define YB_FIX_POINT_TMPL_OP_2_PARAMS_BODY (   _op)
值:
operator _op(const fixed_point<_tBase1, _vInt1, _vFrac1> x, \
const fixed_point<_tBase2, _vInt2, _vFrac2>& y) \
{ \
using result_type = common_type_t<fixed_point<_tBase1, _vInt1, \
_vFrac1>, fixed_point<_tBase2, _vInt2, _vFrac2>>; \
\
return result_type(x) _op result_type(y); \
}
typename common_type< _types...>::type common_type_t
Definition: type_op.hpp:280
自从
build 440

在文件 rational.hpp438 行定义.