Numerical Library

Overview
Standard Library provides classes such as bitset to handle bits, valarray to handle matrix operations. random number generators and distributions.

Details
long long
The size of long is not consistent across platforms. In linux,  it's 64 bits and in Windows it's 32 bits.
The new data type long long address this by keeping size at 64 bits across all the platforms. 
The short form long long is ll or LL.
long long ll = 0LL;
unsigned long long ull = 0uLL;

numeric_limits is a template class that defines functions such as min(), max() along with host of other functions that are related to arithmetic types. 
Specialized classes from numeric_limits are defined for fundamental arithmetic types such as int, double. These methods in these classes can be used instead of  of macros. 

Compactly store numbers as bits, access individual bit and perform logical operations on it.

valarray➹
Similar to a vector where mathematical functions can be applied directly to all the elements. It also allows to get different cross section of the elements.

CRT provides limited capability of generating random numbers based on a seed. In C++ 11 numerous random number engines and distributions were introduced.

Summary of Examples
NameDescriptiongithubwandbox
  Example       Usage   source    output  source + output  

No comments:

Post a Comment