NumericAL
A header-only C++20 lexer built on REAL
Loading...
Searching...
No Matches
Classes | Public Types | List of all members
numerical::detail::arithmetic< T > Struct Template Reference

A signed integer's operations through its unsigned type, so that an overflow wraps modulo 2ⁿ as NumPy's integers do (two's complement) where the signed operation is undefined. More...

#include <tensor_ops.hpp>

Classes

struct  minus
 a - b, wrapped. More...
 
struct  multiplies
 a · b, wrapped. More...
 
struct  negate
 -a, wrapped (the most negative value its own negation). More...
 
struct  plus
 a + b, wrapped. More...
 

Public Types

using unsigned_type = std::make_unsigned_t< decltype(T {}+0U)>
 Wide enough that no promotion is signed.
 

Detailed Description

template<std::signed_integral T>
struct numerical::detail::arithmetic< T >

A signed integer's operations through its unsigned type, so that an overflow wraps modulo 2ⁿ as NumPy's integers do (two's complement) where the signed operation is undefined.

Definition at line 2779 of file tensor_ops.hpp.

Member Typedef Documentation

◆ unsigned_type

template<std::signed_integral T>
using numerical::detail::arithmetic< T >::unsigned_type = std::make_unsigned_t<decltype(T {} + 0U)>

Wide enough that no promotion is signed.

Definition at line 2780 of file tensor_ops.hpp.


The documentation for this struct was generated from the following file: