# Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world.

This is the documentation for a snapshot of the develop branch, built from commit 0f79ae966a.

#### How to Determine the Kind of a Number From `std::numeric_limits`

Based on the information above, one can see that different kinds of numbers can be differentiated based on the information stored in `std::numeric_limits`. This is in addition to the traits class number_category provided by this library.

##### Integer Types

For an integer type T, all of the following conditions hold:

```std::numeric_limits<T>::is_specialized == true
std::numeric_limits<T>::is_integer == true
std::numeric_limits<T>::is_exact == true
std::numeric_limits<T>::min_exponent == 0
std::numeric_limits<T>::max_exponent == 0
std::numeric_limits<T>::min_exponent10 == 0
std::numeric_limits<T>::max_exponent10 == 0
```

In addition the type is signed if:

```std::numeric_limits<T>::is_signed == true
```

If the type is arbitrary precision then:

```std::numeric_limits<T>::is_bounded == false
```

Otherwise the type is bounded, and returns a non zero value from:

```std::numeric_limits<T>::max()
```

and has:

```std::numeric_limits<T>::is_modulo == true
```

if the type implements modulo arithmetic on overflow.

##### Rational Types

Rational types are just like integers except that:

```std::numeric_limits<T>::is_integer == false
```
##### Fixed Precision Types

There appears to be no way to tell these apart from rational types, unless they set:

```std::numeric_limits<T>::is_exact == false
```

This is because these types are in essence a rational type with a fixed denominator.

##### floating-point Types

For a floating-point type T, all of the following conditions hold:

```std::numeric_limits<T>::is_specialized == true
std::numeric_limits<T>::is_integer == false
std::numeric_limits<T>::is_exact == false
std::numeric_limits<T>::min_exponent != 0
std::numeric_limits<T>::max_exponent != 0
std::numeric_limits<T>::min_exponent10 != 0
std::numeric_limits<T>::max_exponent10 != 0
```

In addition the type is signed if:

```std::numeric_limits<T>::is_signed == true
```

And the type may be decimal or binary depending on the value of:

```std::numeric_limits<T>::radix
```

In general, there are no arbitrary precision floating-point types, and so:

```std::numeric_limits<T>::is_bounded == false
```
##### Exact floating-point Types

Exact floating-point types are a field composed of an arbitrary precision integer scaled by an exponent. Such types have no division operator and are the same as floating-point types except:

```std::numeric_limits<T>::is_exact == true
```
##### Complex Numbers

For historical reasons, complex numbers do not specialize `std::numeric_limits`, instead you must inspect `std::numeric_limits<typename T::value_type>`.
{"ft_lang_label":"__label__en","ft_lang_prob":0.5285916,"math_prob":0.8813602,"size":2468,"snap":"2020-45-2020-50","text_gpt3_token_len":574,"char_repetition_ratio":0.28003246,"word_repetition_ratio":0.10666667,"special_character_ratio":0.24756888,"punctuation_ratio":0.28056112,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99931836,"pos_list":[0,1,2],"im_url_duplicate_count":[null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-11-24T16:03:54Z\",\"WARC-Record-ID\":\"<urn:uuid:133e7547-6672-4a8a-ae5f-d6f784f53ff7>\",\"Content-Length\":\"17090\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:bfd7f9d6-f88c-4404-bea1-d401992f72f5>\",\"WARC-Concurrent-To\":\"<urn:uuid:42335e1b-4e9c-4175-89c4-ea58432a4ccf>\",\"WARC-IP-Address\":\"146.20.110.251\",\"WARC-Target-URI\":\"https://www.boost.org/doc/libs/develop/libs/multiprecision/doc/html/boost_multiprecision/tut/limits/how_to_tell.html\",\"WARC-Payload-Digest\":\"sha1:6HA4R7SBZH22APOVFTWJLO2JZUEK5BCL\",\"WARC-Block-Digest\":\"sha1:GM3JOJB25QYRLFKXHWLQCEWLFSBG6U5U\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-50/CC-MAIN-2020-50_segments_1606141176864.5_warc_CC-MAIN-20201124140942-20201124170942-00421.warc.gz\"}"}