|
NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
|
128位有符号整数类型 更多...
#include <int128.hpp>
Public 成员函数 | |
| constexpr | int128_t (const long value) noexcept |
| 从 long 构造 | |
| constexpr | int128_t (const int32_t value) noexcept |
| 从32位有符号整数构造 | |
| constexpr | int128_t (const long long value) noexcept |
| 从 long long 构造 | |
| constexpr | int128_t (const uint64_t low, const bool negative=false) noexcept |
| 从低64位和符号构造 | |
| constexpr | int128_t (const uint64_t high, const uint64_t low) noexcept |
| 从高低64位构造 | |
| constexpr int128_t & | operator= (const uint128_t &other) noexcept |
| 从无符号128位整数赋值 | |
| constexpr | int128_t (const string &str, int base=10) |
| 从字符串构造 | |
| constexpr | int128_t (string_view str, int base=10) |
| 从字符串视图构造 | |
| constexpr uint128_t | to_uint128 () const noexcept |
| 转换为无符号128位整数 | |
| constexpr bool | is_negative () const noexcept |
| 检查是否为负数 | |
| constexpr bool | equal_to (const int128_t &rhs) const noexcept |
| 相等比较 | |
| constexpr bool | less_than (const int128_t &rhs) const noexcept |
| 小于比较(考虑符号) | |
| constexpr int128_t | operator- () const noexcept |
| 负号 | |
| int128_t & | operator+= (const int128_t &other) noexcept |
| 加法赋值 | |
| int128_t & | operator-= (const int128_t &other) noexcept |
| 减法赋值 | |
| int128_t & | operator*= (const int128_t &other) noexcept |
| 乘法赋值 | |
| int128_t & | operator/= (const int128_t &other) |
| 除法赋值 | |
| int128_t & | operator%= (const int128_t &other) |
| 取模赋值 | |
| int128_t & | operator++ () noexcept |
| 前置自增 | |
| int128_t & | operator-- () noexcept |
| 前置自减 | |
| constexpr int128_t | operator~ () const noexcept |
| 按位取反 | |
| constexpr int128_t & | operator&= (const int128_t &other) noexcept |
| 按位与赋值 | |
| constexpr int128_t & | operator|= (const int128_t &other) noexcept |
| 按位或赋值 | |
| constexpr int128_t & | operator^= (const int128_t &other) noexcept |
| 按位异或赋值 | |
| constexpr int128_t & | operator<<= (const uint32_t shift) noexcept |
| 左移赋值 | |
| constexpr int128_t & | operator>>= (const uint32_t shift) noexcept |
| 右移赋值(算术右移) | |
| constexpr size_t | to_hash () const noexcept |
| 计算哈希值 | |
| constexpr string | to_string () const |
| 转换为字符串 | |
| Public 成员函数 继承自 icomparable< int128_t > | |
| constexpr bool | operator== (const int128_t &rhs) const noexcept(noexcept(derived().equal_to(rhs))) |
| 相等比较运算符 | |
| constexpr bool | operator!= (const int128_t &rhs) const noexcept(noexcept(!(derived().equal_to(rhs)))) |
| 不等比较运算符 | |
| constexpr bool | operator< (const int128_t &rhs) const noexcept(noexcept(derived().less_than(rhs))) |
| 小于比较运算符 | |
| constexpr bool | operator> (const int128_t &rhs) const noexcept(noexcept(rhs.less_than(derived()))) |
| 大于比较运算符 | |
| constexpr bool | operator<= (const int128_t &rhs) const noexcept(noexcept(!(rhs.less_than(derived())))) |
| 小于等于比较运算符 | |
| constexpr bool | operator>= (const int128_t &rhs) const noexcept(noexcept(!(derived().less_than(rhs)))) |
| 大于等于比较运算符 | |
| Public 成员函数 继承自 ihashable< int128_t > | |
| constexpr size_t | to_ihash () const noexcept(noexcept(derived().to_hash())) |
| 获取对象的哈希值 | |
| Public 成员函数 继承自 iarithmetic< int128_t > | |
| constexpr int128_t | operator+ (const int128_t &other) const noexcept(noexcept(const_cast< int128_t & >(derived()).operator+=(other))) |
| 加法运算符 | |
| constexpr int128_t | operator- (const int128_t &other) const noexcept(noexcept(const_cast< int128_t & >(derived()).operator-=(other))) |
| 减法运算符 | |
| constexpr int128_t | operator* (const int128_t &other) const noexcept(noexcept(const_cast< int128_t & >(derived()).operator*=(other))) |
| 乘法运算符 | |
| constexpr int128_t | operator/ (const int128_t &other) const noexcept(noexcept(const_cast< int128_t & >(derived()).operator/=(other))) |
| 除法运算符 | |
| constexpr int128_t | operator% (const int128_t &other) const noexcept(noexcept(const_cast< int128_t & >(derived()).operator%=(other))) |
| 取模运算符 | |
| constexpr int128_t & | operator+= (const int128_t &other) noexcept(noexcept(derived().operator+=(other))) |
| 加法赋值运算符 | |
| constexpr int128_t & | operator-= (const int128_t &other) noexcept(noexcept(derived().operator-=(other))) |
| 减法赋值运算符 | |
| constexpr int128_t & | operator*= (const int128_t &other) noexcept(noexcept(derived().operator*=(other))) |
| 乘法赋值运算符 | |
| constexpr int128_t & | operator/= (const int128_t &other) |
| 除法赋值运算符 | |
| constexpr int128_t & | operator%= (const int128_t &other) |
| 取模赋值运算符 | |
| constexpr int128_t & | operator++ () noexcept(noexcept(derived().operator++())) |
| 前置自增运算符 | |
| constexpr int128_t & | operator-- () noexcept(noexcept(derived().operator--())) |
| 前置自减运算符 | |
| Public 成员函数 继承自 ibinary< int128_t > | |
| constexpr int128_t | operator& (const int128_t &other) const noexcept(noexcept(const_cast< int128_t & >(derived()).operator&=(other))) |
| 按位与运算符 | |
| constexpr int128_t | operator| (const int128_t &other) const noexcept(noexcept(const_cast< int128_t & >(derived()).operator|=(other))) |
| 按位或运算符 | |
| constexpr int128_t | operator^ (const int128_t &other) const noexcept(noexcept(const_cast< int128_t & >(derived()).operator^=(other))) |
| 按位异或运算符 | |
| constexpr int128_t | operator~ () const noexcept(noexcept(derived().operator~())) |
| 按位取反运算符 | |
| constexpr int128_t | operator<< (const uint32_t shift) const |
| 左移运算符 | |
| constexpr int128_t | operator>> (const uint32_t shift) const |
| 右移运算符 | |
| constexpr int128_t & | operator&= (const int128_t &other) noexcept(noexcept(derived().operator&=(other))) |
| 按位与赋值运算符 | |
| constexpr int128_t & | operator|= (const int128_t &other) noexcept(noexcept(derived().operator|=(other))) |
| 按位或赋值运算符 | |
| constexpr int128_t & | operator^= (const int128_t &other) noexcept(noexcept(derived().operator^=(other))) |
| 按位异或赋值运算符 | |
| constexpr int128_t & | operator<<= (const uint32_t shift) |
| 左移赋值运算符 | |
| constexpr int128_t & | operator>>= (const uint32_t shift) |
| 右移赋值运算符 | |
| Public 成员函数 继承自 iobject< int128_t > | |
| constexpr bool | try_parse (const string_view str) noexcept |
| 尝试从字符串解析对象 | |
| Public 成员函数 继承自 istringify< int128_t > | |
| constexpr string | to_string () const |
| 转换为字符串 | |
静态 Public 成员函数 | |
| static constexpr int128_t | parse (const string_view view) |
| 从字符串解析 | |
| static constexpr int128_t | min () noexcept |
| 获取最小值 | |
| static constexpr int128_t | max () noexcept |
| 获取最大值 | |
| 静态 Public 成员函数 继承自 iobject< int128_t > | |
| static constexpr int128_t | parse (const string_view str) |
| 从字符串解析对象 | |
Public 属性 | |
| uint64_t | lo {0} |
| 低64位 | |
| uint64_t | hi {0} |
| 高64位 | |
128位有符号整数类型
在文件 int128.hpp 第 322 行定义.
|
inlineconstexprnoexcept |
|
inlineexplicitconstexpr |
|
explicitconstexpr |
从字符串视图构造
| str | 数字字符串视图 |
| base | 进制基数(默认10) |
| typecast_exception | 字符串格式无效时抛出 |
在文件 int128.hpp 第 829 行定义.
引用了 to_int128().
取模赋值
| math_exception | 除数为0时抛出 |
除法赋值
| math_exception | 除数为0时抛出 |
|
inlinestaticconstexpr |
|
nodiscardconstexpr |