## Definitions 定義

### Introduction 簡介

This section provides definitions of terms used in the Numeric Conversion library.

### Types and Values 類型與值

As defined by the C++ Object Model (§1.7) the storage or memory on which a C++ program runs is a contiguous sequence of bytes where each byte is a contiguous sequence of bits.
C++ 對像模型 (§1.7) 中所定義的，一個C++程序運行於其上的 存儲 或內存是指一段連續的 字節，其中每個字節都 是一段連續的二進制位。

An object is a region of storage (§1.8) and has a type (§3.9).

A type is a discrete set of values.

An object of type `T` has an object representation which is the sequence of bytes stored in the object (§3.9/4)

An object of type `T` has a value representation which is the set of bits that determine the value of an object of that type (§3.9/4). For POD types (§3.9/10), this bitset is given by the object representation, but not all the bits in the storage need to participate in the value representation (except for character types): for example, some bits might be used for padding or there may be trap-bits.

The typed value that is held by an object is the value which is determined by its value representation.

An abstract value (untyped) is the conceptual information that is represented in a type (i.e. the number π).

The intrinsic value of an object is the binary value of the sequence of unsigned characters which form its object representation.

Abstract values can be represented in a given type.

To represent an abstract value `V` in a type `T` is to obtain a typed value `v` which corresponds to the abstract value `V`.

The operation is denoted using the `rep()` operator, as in: `v=rep(V)`. `v` is the representation of `V` in the type `T`.

For example, the abstract value π can be represented in the type `double` as the `double value M_PI` and in the type `int` as the ```int value 3 ```例如，抽像值 π 可以在類型 `double` 中表示為 ```double value M_PI```，而在類型 `int` 中表示為 ```int value 3```

Conversely, typed values can be abstracted.

To abstract a typed value `v` of type `T` is to obtain the abstract value `V` whose representation in `T` is `v`.

The operation is denoted using the `abt()` operator, as in: `V=abt(v)`.

`V` is the abstraction of `v` of type `T`.
`V` 是類型 `T``v` 值的 抽像

Abstraction is just an abstract operation (you can't do it); but it is defined nevertheless because it will be used to give the definitions in the rest of this document.

### C++ Arithmetic Types  C++算術類型

The C++ language defines fundamental types (§3.9.1). The following subsets of the fundamental types are intended to represent numbers:
C++ 語言定義了一些 基本類型 (§3.9.1)。以下是基本類型的一個子集，它們用於表示 數 字

signed integer types (§3.9.1/2):

```{signed char, signed short int, signed int, signed long int}``` Can be used to represent general integer numbers (both negative and positive).
```{signed char, signed short int, signed int, signed long int}``` 可用於表示普通的整數(包括負數和正數)。

unsigned integer types (§3.9.1/3):

```{unsigned char, unsigned short int, unsigned int, unsigned long int}``` Can be used to represent positive integer numbers with modulo-arithmetic.
```{unsigned char, unsigned short int, unsigned int, unsigned long int}``` 可用於表示模算術中的正整數。

floating-point types (§3.9.1/8):

```{float,double,long double}``` Can be used to represent real numbers.
`{float,double,long double}` 可用於表示實數。

integral or integer types (§3.9.1/7):

```{{signed integers},{unsigned integers}, bool, char and wchar_t}```

arithmetic types (§3.9.1/8):

```{{integer types},{floating types}}```

The integer types are required to have a binary value representation.

Additionally, the signed/unsigned integer types of the same base type (`short`, `int` or `long`) are required to have the same value representation, that is:

` int i = -3 ; // suppose value representation is: 10011 (sign bit + 4 magnitude bits) // 假設值表示法為：10011 (符號位 + 4 數量位) unsigned int u = i ; // u is required to have the same 10011 as its value representation. // u 被要求具有與 10011 相同的值表示法`

In other words, the integer types signed/unsigned X use the same value representation but a different interpretation of it; that is, their typed values might differ.

Another consequence of this is that the range for signed X is always a smaller subset of the range of unsigned X, as required by §3.9.1/3.

Note 說明 Always remember that unsigned types, unlike signed types, have modulo-arithmetic; that is, they do not overflow. This means that: 請記住，無符號類型不像有符號類型，它具有模算術；即它們不會溢出。這意味著： - Always be extra careful when mixing signed/unsigned types - 在混合使用有符號/無符號類型時，一定要額外小心 - Use unsigned types only when you need modulo arithmetic or very very large numbers. Don't use unsigned types just because you intend to deal with positive values only (you can do this with signed types as well). - 僅在你需要模算術或需要很大很大的數字時，才使用無符號類型。不要只是因為你想處理正整數而使用無符號類型(你可以用有符號類型來處理)。

### Numeric Types 數字類型

This section introduces the following definitions intended to integrate arithmetic types with user-defined types which behave like numbers. Some definitions are purposely broad in order to include a vast variety of user-defined number types.

Within this library, the term number refers to an abstract numeric value.

A type is numeric if:

• It is an arithmetic type, or,
它是一個算術類型，或者，
• It is a user-defined type which
它是一個用戶自定義類型，滿足
• Represents numeric abstract values (i.e. numbers).
它表示了數字抽像值(如多位數字)。
• Can be converted (either implicitly or explicitly) to/from at least one arithmetic type.
它可以與至少一種算術類型相互轉換(隱式或顯式)。
• Has range (possibly unbounded) and precision (possibly dynamic or unlimited).
它具有 范 圍 (可能是無界的)和 精 度 (可能是動態或無限的)。
• Provides an specialization of `std::numeric_limits`.
它提供了對 `std::numeric_limits` 的特化。

A numeric type is signed if the abstract values it represent include negative numbers.

A numeric type is unsigned if the abstract values it represent exclude negative numbers.

A numeric type is modulo if it has modulo-arithmetic (does not overflow).

A numeric type is integer if the abstract values it represent are whole numbers.

A numeric type is floating if the abstract values it represent are real numbers.

An arithmetic value is the typed value of an arithmetic type

A numeric value is the typed value of a numeric type

These definitions simply generalize the standard notions of arithmetic types and values by introducing a superset called numeric. All arithmetic types and values are numeric types and values, but not vice versa, since user-defined numeric types are not arithmetic types.

The following examples clarify the differences between arithmetic and numeric types (and values):

```// A numeric type which is not an arithmetic type (is user-defined)// and which is intended to represent integer numbers (i.e., an 'integer' numeric type)// 一個不是算術類型的數字類型(用戶自定義的)，它用於表示整數(即一個'整型'的數字類型)class MyInt{MyInt ( long long v ) ;long long to_builtin();} ;namespace std {template<> numeric_limits<MyInt> { ... } ;}// A 'floating' numeric type (double) which is also an arithmetic type (built-in),// with a float numeric value.// 一個'浮點'的數字類型(double)，同時也是算術類型(內建的)，具有浮點數值。double pi = M_PI ;// A 'floating' numeric type with a whole numeric value.// NOTE: numeric values are typed valued, hence, they are, for instance,// integer or floating, despite the value itself being whole or including// a fractional part.// 一個具有整數值的'浮點'數字類型。註：數字值是有類型值，因此它們是整型的或浮點型的，// 無論它的值本身是整數的還是帶有小數的。double two = 2.0 ;// An integer numeric type with an integer numeric value.// 一個具有整型數字值的整型數字類型。MyInt i(1234);
```

### Range and Precision 範圍與精度

Given a number set `N`, some of its elements are representable in a numeric type `T`.

The set of representable values of type `T`, or numeric set of `T`, is a set of numeric values whose elements are the representation of some subset of `N`.

For example, the interval of `int` values `[INT_MIN,INT_MAX]` is the set of representable values of type `int`, i.e. the `int` numeric set, and corresponds to the representation of the elements of the interval of abstract values `[abt(INT_MIN),abt(INT_MAX)]` from the integer numbers.

Similarly, the interval of `double` values `[-DBL_MAX,DBL_MAX]` is the `double` numeric set, which corresponds to the subset of the real numbers from `abt(-DBL_MAX)` to `abt(DBL_MAX)`.

Let `next(x)` denote the lowest numeric value greater than x.

Let `prev(x)` denote the highest numeric value lower then x.
`prev(x)` 表示小於 x 的最大數字值。

Let `v=prev(next(V))` and `v=next(prev(V))` be identities that relate a numeric typed value `v` with a number `V`.
`v=prev(next(V))``v=next(prev(V))` 是相同的，將一個數字類型值 `v` 與一個數字 `V` 關聯起來。

An ordered pair of numeric values `x`,`y` s.t. `x<y` are consecutive iff `next(x)==y`.

The abstract distance between consecutive numeric values is usually referred to as a Unit in the Last Place, or ulp for short. A ulp is a quantity whose abstract magnitude is relative to the numeric values it corresponds to: If the numeric set is not evenly distributed, that is, if the abstract distance between consecutive numeric values varies along the set -as is the case with the floating-point types-, the magnitude of 1ulp after the numeric value `x` might be (usually is) different from the magnitude of a 1ulp after the numeric value y for `x!=y`.

Since numbers are inherently ordered, a numeric set of type `T` is an ordered sequence of numeric values (of type `T`) of the form:

```REP(T)={l,next(l),next(next(l)),...,prev(prev(h)),prev(h),h}
```

where `l` and `h` are respectively the lowest and highest values of type `T`, called the boundary values of type `T`.

A numeric set is discrete. It has a size which is the number of numeric values in the set, a width which is the abstract difference between the highest and lowest boundary values: `[abt(h)-abt(l)]`, and a density which is the relation between its size and width: `density=size/width`.

The integer types have density 1, which means that there are no unrepresentable integer numbers between `abt(l)` and `abt(h)` (i.e. there are no gaps). On the other hand, floating types have density much smaller than 1, which means that there are real numbers unrepresented between consecutive floating values (i.e. there are gaps).

The interval of abstract values `[abt(l),abt(h)]` is the range of the type `T`, denoted `R(T)`.

A range is a set of abstract values and not a set of numeric values. In other documents, such as the C++ standard, the word `range` is sometimes used as synonym for `numeric set`, that is, as the ordered sequence of numeric values from `l` to `h`. In this document, however, a range is an abstract interval which subtends the numeric set.

For example, the sequence `[-DBL_MAX,DBL_MAX]` is the numeric set of the type `double`, and the real interval `[abt(-DBL_MAX),abt(DBL_MAX)]` is its range.

Notice, for instance, that the range of a floating-point type is continuous unlike its numeric set.

This definition was chosen because:

• (a) The discrete set of numeric values is already given by the numeric set.
(a) 數字值的離散集已經由數字集合給出。
• (b) Abstract intervals are easier to compare and overlap since only boundary values need to be considered.
(b) 抽像區間更易於比較和取交集，因為只需要考慮其邊界值即可。

This definition allows for a concise definition of `subranged` as given in the last section.

The width of a numeric set, as defined, is exactly equivalent to the width of a range.

The precision of a type is given by the width or density of the numeric set.

For integer types, which have density 1, the precision is conceptually equivalent to the range and is determined by the number of bits used in the value representation: The higher the number of bits the bigger the size of the numeric set, the wider the range, and the higher the precision.

For floating types, which have density <<1, the precision is given not by the width of the range but by the density. In a typical implementation, the range is determined by the number of bits used in the exponent, and the precision by the number of bits used in the mantissa (giving the maximum number of significant digits that can be exactly represented). The higher the number of exponent bits the wider the range, while the higher the number of mantissa bits, the higher the precision.

### Exact, Correctly Rounded and Out-Of-Range Representations 精確的、適當捨入的和超出範圍的表示法

Given an abstract value `V` and a type `T` with its corresponding range `[abt(l),abt(h)]`:

If ```V < abt(l)``` or ```V > abt(h)```, `V` is not representable (cannot be represented) in the type `T`, or, equivalently, it's representation in the type `T` is out of range, or overflows.

• If ```V < abt(l)```, the overflow is negative.
如果 ```V < abt(l)```，則 溢出為負
• If ```V > abt(h)```, the overflow is positive.
如果 ```V > abt(h)```，則 溢出為正

If ```V >= abt(l)``` and ```V <= abt(h)```, `V` is representable (can be represented) in the type `T`, or, equivalently, its representation in the type `T` is in range, or does not overflow.

Notice that a numeric type, such as a C++ unsigned type, can define that any `V` does not overflow by always representing not `V` itself but the abstract value ```U = [ V % (abt(h)+1) ]```, which is always in range.

Given an abstract value `V` represented in the type `T` as `v`, the roundoff error of the representation is the abstract difference: `(abt(v)-V)`.

Notice that a representation is an operation, hence, the roundoff error corresponds to the representation operation and not to the numeric value itself (i.e. numeric values do not have any error themselves)

• If the roundoff is 0, the representation is exact, and `V` is exactly representable in the type `T`.
如果捨入為0，則表示是 精確的`V` 在類型 `T` 中可以精確表示。
• If the roundoff is not 0, the representation is inexact, and `V` is inexactly representable in the type `T`.
如果捨入不是0，則表示是 不精確的`V` 在類型 `T` 中不能精確表示。

If a representation `v` in a type `T` -either exact or inexact-, is any of the adjacents of `V` in that type, that is, if `v==prev` or `v==next`, the representation is faithfully rounded. If the choice between `prev` and `next` matches a given rounding direction, it is correctly rounded.

All exact representations are correctly rounded, but not all inexact representations are. In particular, C++ requires numeric conversions (described below) and the result of arithmetic operations (not covered by this document) to be correctly rounded, but batch operations propagate roundoff, thus final results are usually incorrectly rounded, that is, the numeric value `r` which is the computed result is neither of the adjacents of the abstract value `R` which is the theoretical result.

Because a correctly rounded representation is always one of adjacents of the abstract value being represented, the roundoff is guaranteed to be at most 1ulp.

The following examples summarize the given definitions. Consider:

• A numeric type `Int` representing integer numbers with a numeric set: `{-2,-1,0,1,2}` and range: `[-2,2]`
數字類型 `Int` 表示 數字集合`{-2,-1,0,1,2}`範圍 `[-2,2]` 的整數
• A numeric type `Cardinal` representing integer numbers with a numeric set: `{0,1,2,3,4,5,6,7,8,9}` and range: `[0,9]` (no modulo-arithmetic here)
數字類型 `Cardinal` 表示 數字集合`{0,1,2,3,4,5,6,7,8,9}`範圍`[0,9]` (不帶模算術) 的整數
• A numeric type `Real` representing real numbers with a numeric set: `{-2.0,-1.5,-1.0,-0.5,-0.0,+0.0,+0.5,+1.0,+1.5,+2.0}` and range: `[-2.0,+2.0]`
數字類型 `Real` 表示 數字集合`{-2.0,-1.5,-1.0,-0.5,-0.0,+0.0,+0.5,+1.0,+1.5,+2.0}`範圍`[-2.0,+2.0]` 的實數
• A numeric type `Whole` representing real numbers with a numeric set: `{-2.0,-1.0,0.0,+1.0,+2.0}` and range: `[-2.0,+2.0]`
如數字類型 `Whole` 表示 數字集合`{-2.0,-1.0,0.0,+1.0,+2.0}`範圍`[-2.0,+2.0]` 的實數

First, notice that the types `Real` and `Whole` both represent real numbers, have the same range, but different precision.

• The integer number `1` (an abstract value) can be exactly represented in any of these types.
整數 `1` (抽像值)可以在以上任一個類型中被精確表示。
• The integer number `-1` can be exactly represented in `Int`, `Real` and `Whole`, but cannot be represented in `Cardinal`, yielding negative overflow.
整數 `-1` 可以在 `Int`, `Real``Whole` 中被精確表示，但不能在 `Cardinal` 中表示，會產生負溢出。
• The real number `1.5` can be exactly represented in `Real`, and inexactly represented in the other types.
實數 `1.5` 可以在 `Real` 中精確表示，並在其它類型中不精確地表示。
• If `1.5` is represented as either `1` or `2` in any of the types (except `Real`), the representation is correctly rounded.
如果 `1.5` 在任一類型(除了 `Real`)中被表示為 `1``2`，該表示是適當捨入的。
• If `0.5` is represented as `+1.5` in the type `Real`, it is incorrectly rounded.
如果 `0.5` 在類型 `Real` 中被表示為 `+1.5`，則是不正確捨入的。
• `(-2.0,-1.5)` are the `Real` adjacents of any real number in the interval `[-2.0,-1.5]`, yet there are no `Real` adjacents for ```x < -2.0```, nor for ```x > +2.0```.
`(-2.0,-1.5)` 是區間 `[-2.0,-1.5]` 中任一實數的 `Real` 鄰值，但是對於 ```x < -2.0```, 和 ```x > +2.0``` 則沒有 `Real` 鄰值。

### Standard (numeric) Conversions 標準的(數字)轉換

The C++ language defines Standard Conversions (§4) some of which are conversions between arithmetic types.
C++語言定義了 標準轉換 (§4)，其中包括算術類型間的轉換。

These are Integral promotions (§4.5), Integral conversions (§4.7), Floating point promotions (§4.6), Floating point conversions (§4.8) and Floating-integral conversions (§4.9).

In the sequel, integral and floating point promotions are called arithmetic promotions, and these plus integral, floating-point and floating-integral conversions are called arithmetic conversions (i.e, promotions are conversions).

Promotions, both Integral and Floating point, are value-preserving, which means that the typed value is not changed with the conversion.

In the sequel, consider a source typed value `s` of type `S`, the source abstract value `N=abt(s)`, a destination type `T`; and whenever possible, a result typed value `t` of type `T`.

Integer to integer conversions are always defined:

• If `T` is unsigned, the abstract value which is effectively represented is not `N` but ```M=[ N % ( abt(h) + 1 ) ]```, where `h` is the highest unsigned typed value of type `T`.
如果 `T` 是無符號的，則有效表示的抽像值不是 `N` 而是 ```M=[ N % ( abt(h) + 1 ) ]```，其中 `h` 是類型 `T` 的最大無符號有類型值。
• If `T` is signed and `N` is not directly representable, the result `t` is implementation-defined, which means that the C++ implementation is required to produce a value `t` even if it is totally unrelated to `s`.
如果 `T` 是有符號的且 `N` 不是可直接表示的，則結果 `t`依實現定義的，即C++實現被要求產生一個值 `t` 即使它與 `s` 完全無關。

Floating to Floating conversions are defined only if `N` is representable; if it is not, the conversion has undefined behavior.

• If `N` is exactly representable, `t` is required to be the exact representation.
如果 `N` 是可以精確表示的，則要求 `t` 是精確表示。
• If `N` is inexactly representable, `t` is required to be one of the two adjacents, with an implementation-defined choice of rounding direction; that is, the conversion is required to be correctly rounded.
如果 `N` 是不可精確表示的，則要求 `t` 是兩個鄰值之一，捨入的方向由實現定義來選擇；即要求轉換是適當捨入的。

Floating to Integer conversions represent not `N` but `M=trunc(N)`, were `trunc()` is to truncate: i.e. to remove the fractional part, if any.

• If `M` is not representable in `T`, the conversion has undefined behavior (unless `T` is `bool`, see §4.12).
如果 `M``T` 中不可表示，則轉換是 未定義行為 (除非 `T``bool`，請見 §4.12)。

Integer to Floating conversions are always defined.

• If `N` is exactly representable, `t` is required to be the exact representation.
如果 `N` 是可精確表示的，則要求 `t` 是精確表示。
• If `N` is inexactly representable, `t` is required to be one of the two adjacents, with an implementation-defined choice of rounding direction; that is, the conversion is required to be correctly rounded.
如果 `N` 是不可精確表示的，則要求 `t` 是兩個鄰值之一，捨入的方向由實現定義來選擇；即要求轉換是適當捨入的。

### Subranged Conversion Direction, Subtype and Supertype 子範圍轉換方向、子類型和父類型

Given a source type `S` and a destination type `T`, there is a conversion direction denoted: `S->T`.

For any two ranges the following range relation can be defined: A range `X` can be entirely contained in a range `Y`, in which case it is said that `X` is enclosed by `Y`.

Formally: `R(S)` is enclosed by `R(T)` iif ```(R(S) intersection R(T)) == R(S)```.

If the source type range, `R(S)`, is not enclosed in the target type range, `R(T)`; that is, if ```(R(S) & R(T)) != R(S)```, the conversion direction is said to be subranged, which means that `R(S)` is not entirely contained in `R(T)` and therefore there is some portion of the source range which falls outside the target range. In other words, if a conversion direction `S->T` is subranged, there are values in `S` which cannot be represented in `T` because they are out of range. Notice that for `S->T`, the adjective subranged applies to `T`.

Examples:

Given the following numeric types all representing real numbers:

• `X` with numeric set `{-2.0,-1.0,0.0,+1.0,+2.0}` and range `[-2.0,+2.0]`
`X` 的數字集合為 `{-2.0,-1.0,0.0,+1.0,+2.0}` 範圍為 `[-2.0,+2.0]`
• `Y` with numeric set `{-2.0,-1.5,-1.0,-0.5,0.0,+0.5,+1.0,+1.5,+2.0}` and range `[-2.0,+2.0]`
`Y` 的數字集合為 `{-2.0,-1.5,-1.0,-0.5,0.0,+0.5,+1.0,+1.5,+2.0}` 範圍為 `[-2.0,+2.0]`
• `Z` with numeric set `{-1.0,0.0,+1.0}` and range `[-1.0,+1.0]`
`Z` 的數字集合為 `{-1.0,0.0,+1.0}` 範圍為 `[-1.0,+1.0]`

For:

(a) X->Y:

```R(X) & R(Y) == R(X)```, then `X->Y` is not subranged. Thus, all values of type `X` are representable in the type `Y`.
```R(X) & R(Y) == R(X)```，則 `X->Y` 不是子範圍的。因此，類型 `X` 的所有值在類型 `Y` 中都可以表示。

(b) Y->X:

```R(Y) & R(X) == R(Y)```, then `Y->X` is not subranged. Thus, all values of type `Y` are representable in the type `X`, but in this case, some values are inexactly representable (all the halves). (note: it is to permit this case that a range is an interval of abstract values and not an interval of typed values)
```R(Y) & R(X) == R(Y)```，則 `Y->X` 不是子範圍的。因此，類型 `Y` 的所有值在類型 `X` 中都可以表示，但是有些值是非精確表示的(所有帶0.5的)。(註：可以允許這種情形，即範圍是一個抽像值的區間而不是一個有類型值的區間)

(b) X->Z:

```R(X) & R(Z) != R(X)```, then `X->Z` is subranged. Thus, some values of type `X` are not representable in the type `Z`, they fall out of range ```(-2.0 and +2.0)```.
```R(X) & R(Z) != R(X)```, 則 `X->Z` 是子範圍的。因此，類型 `X` 有些值在類型 `Z` 中不能表示，它們超出了 ```(-2.0 and +2.0)``` 的範圍。

It is possible that `R(S)` is not enclosed by `R(T)`, while neither is `R(T)` enclosed by `R(S)`; for example, `UNSIG=[0,255]` is not enclosed by `SIG=[-128,127]`; neither is `SIG` enclosed by `UNSIG`. This implies that is possible that a conversion direction is subranged both ways. This occurs when a mixture of signed/unsigned types are involved and indicates that in both directions there are values which can fall out of range.

Given the range relation (subranged or not) of a conversion direction `S->T`, it is possible to classify `S` and `T` as supertype and subtype: If the conversion is subranged, which means that `T` cannot represent all possible values of type `S`, `S` is the supertype and `T` the subtype; otherwise, `T` is the supertype and `S` the subtype.

For example:

`R(float)=[-FLT_MAX,FLT_MAX]` and `R(double)=[-DBL_MAX,DBL_MAX]R(float)=[-FLT_MAX,FLT_MAX]``R(double)=[-DBL_MAX,DBL_MAX]`

If `FLT_MAX < DBL_MAX`:

• `double->float` is subranged and `supertype=double`, `subtype=float`.
`double->float` 是子範圍的且 `supertype=double`, `subtype=float`.
• `float->double` is not subranged and `supertype=double`, `subtype=float`.
`float->double` 不是子範圍的且 `supertype=double`, `subtype=float`.

Notice that while `double->float` is subranged, `float->double` is not, which yields the same supertype,subtype for both directions.

Now consider:

`R(int)=[INT_MIN,INT_MAX]` and ```R(unsigned int)=[0,UINT_MAX]R(int)=[INT_MIN,INT_MAX]``````R(unsigned int)=[0,UINT_MAX]```

A C++ implementation is required to have ```UINT_MAX > INT_MAX``` (§3.9/3), so:
C++ 實現要求具有 ```UINT_MAX > INT_MAX``` (§3.9/3)，所以：

• 'int->unsigned' is subranged (negative values fall out of range) and `supertype=int`, `subtype=unsigned`.
'int->unsigned' 是子範圍的(負值超出了範圍)且 `supertype=int`, `subtype=unsigned`.
• 'unsigned->int' is also subranged (high positive values fall out of range) and `supertype=unsigned`, `subtype=int`.
'unsigned->int' 也是子範圍的(高位值超出了範圍)且 `supertype=unsigned`, `subtype=int`.

In this case, the conversion is subranged in both directions and the supertype,subtype pairs are not invariant (under inversion of direction). This indicates that none of the types can represent all the values of the other.

When the supertype is the same for both `S->T` and `T->S`, it is effectively indicating a type which can represent all the values of the subtype. Consequently, if a conversion `X->Y` is not subranged, but the opposite `(Y->X)` is, so that the supertype is always `Y`, it is said that the direction `X->Y` is correctly rounded value preserving, meaning that all such conversions are guaranteed to produce results in range and correctly rounded (even if inexact). For example, all integer to floating conversions are correctly rounded value preserving.