• Complain

Peter Van Weert - C++ Standard Library Quick Reference

Here you can read online Peter Van Weert - C++ Standard Library Quick Reference full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2016, publisher: Apress, genre: Home and family. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Peter Van Weert C++ Standard Library Quick Reference

C++ Standard Library Quick Reference: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "C++ Standard Library Quick Reference" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

This quick reference is a condensed guide to the essential data structures, algorithms, and functions provided by the C++ Standard Library. Used by millions of C++ programmers on a daily basis, the C++ Standard Library features core classes for strings, I/O streams, and various generic containers, as well as a comprehensive set of algorithms to manipulate them. In recent years, the C++11 and C++14 standards have added even more efficient container classes, a new powerful regular expression library, and a portable multithreading library featuring threads, mutexes, condition variables, and atomic variables. Needless to say, it is hard to know and remember all the possibilities, details, and intricacies of this vast and growing library. This handy reference guide is therefore indispensable to any C++ programmer. It offers a condensed, well-structured summary of all essential aspects of the C++ Standard Library. No page-long, repetitive examples or obscure, rarely used features. Instead, everything you need to know and watch out for in practice is outlined in a compact, to-the-point style, interspersed with practical tips and well-chosen, clarifying examples. The book does not explain the C++ language or syntax, but is accessible to anyone with basic C++ knowledge or programming experience. Even the most experienced C++ programmer though will learn a thing or two from it and find it a useful memory-aid. Among the topics covered are: What You Will Learn Gain the essentials that the C++ Standard Library has to offer Use containers to efficiently store and retrieve your data Use algorithms to inspect and manipulate your data See how lambda expressions allow for elegant use of algorithms Discover what the standard string class provides and how to use it Write localized applications Work with file and stream-based I/O Discover what smart pointers are and how to use them to prevent memory leaks Write safe and efficient multi-threaded code using the threading libraries Who This Book Is For All C++ programmers: irrespective of their proficiency with the language or the Standard Library, this book offers an indispensable reference and memory-aid. A secondary audience is developers who are new to C++, but not new to programming, and who want to learn more on the C++ Standard Library in a quick, condensed manner.

Peter Van Weert: author's other books


Who wrote C++ Standard Library Quick Reference? Find out the surname, the name of the author of the book and a list of all author's works by series.

C++ Standard Library Quick Reference — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "C++ Standard Library Quick Reference" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Peter Van Weert and Marc Gregoire 2016
Peter Van Weert and Marc Gregoire C++ Standard Library Quick Reference 10.1007/978-1-4842-1876-1_1
1. Numerics and Math
Peter Van Weert 1 and Marc Gregoire 2
(1)
Kessel-Lo, Belgium
(2)
Meldert, Belgium
Electronic supplementary material
The online version of this chapter (doi: 10.1007/978-1-4842-1876-1_1 ) contains supplementary material, which is available to authorized users.
Common Mathematical Functions
The header defines an extensive collection of common math functions in the std namespace. Unless otherwise specified, all functions are overloaded to accept all standard numerical types, with the following rules for determining the return type:
  • If all arguments are float , the return type is float as well. Analogous for double and long double inputs.
  • If mixed types or integers are passed, these numbers are converted to double , and a double is returned as well. If one of the inputs is a long double , long double is used instead.
Basic Functions
Function
Description
abs(x)
fabs(x)
Returns the absolute value of x. defines abs() , labs() , and llabs() for int types; that abs() has return type int , which is different from the abs() in ( double ).
fmod(x, y)
remainder(x, y)
Returns the remainder of Picture 1 . For fmod() , the result always has the same sign as x ; for remainder() , that is not necessarily true. E.g.: mod(1,4) = rem(1,4) = 1 , but mod(3,4) = 3 and rem(3,4) = -1 .
remquo(x, y, *q)
Returns the same value as remainder(). q is a pointer to an int and receives a value with the sign of Picture 2 and at least the last three bits of the integral quotient itself (rounded to the nearest).
fma(x, y, z)
Computes Picture 3 in an accurate (better precision and rounding properties than a naive implementation) and efficient (uses a single hardware instruction if possible) manner.
fmin(x, y)
fmax(x, y)
Returns the minimum or maximum of x and y .
fdim(x, y)
Returns the positive difference, i.e. C Standard Library Quick Reference - image 4 .
nan(string)
nanf(string)
nanl(string)
Returns a quiet (non-signaling) NaN (not a number) of type double , float , respectively long double , if available ( otherwise). The string parameter is an implementation-dependent tag that can be used to differentiate between different NaN values. Both "" and nullptr are valid and result in a generic quiet NaN.
Exponential and Logarithmic Functions
Function
Formula
Function
Formula
Function
Formula
exp(x)
e x
exp2(x)
2 x
expm1(x)
C Standard Library Quick Reference - image 5
log(x)
C Standard Library Quick Reference - image 6
log10(x)
log10 x
log2(x)
log2 x
log1p(x)
Picture 7
Power Functions
Function
Formula
Function
Formula
pow(x, y)
x y
sqrt(x)
Picture 8
hypot(x, y)
Picture 9
cbrt(x)
Picture 10
Trigonometric and Hyperbolic Functions
All basic trigonometric ( sin() , cos() , tan() , asin() , acos() , atan() ) and hyperbolic functions ( sinh() , cosh() , tanh() , asinh() , acosh() , atanh() ) are provided. The lesser-known trigonometric function atan2() is provided as well. It is used to compute the angle between a vector ( x , y ) and the positive X axis, with atan2(y,x) similar to atan(y/x) except that its result correctly reflects the quadrant the vector is in (and that it also works if x is ). Essentially, by dividing y by x in atan(y/x) , you lose information regarding the sign of x and y .
Error and Gamma Functions
Function
Formula
Function
Formula
erf(x)
C Standard Library Quick Reference - image 11
tgamma(x)
erfcx lgammax ln x Integral Rounding of - photo 12
erfc(x)
lgammax ln x Integral Rounding of Floating-Point Numbers - photo 13
lgamma(x)
ln(|( x )|)
Integral Rounding of Floating-Point Numbers
Function
Description
ceil(x)
floor(x)
Rounds up / down to an integer. That is: returns the nearest integer that is not less / not greater than x .
trunc(x)
Returns the nearest integer not greater in absolute value than x .
round(x)
lround(x)
llround(x)
Returns the integral value nearest to x , rounding halfway cases away from zero. The return type of round() is based as usual on the type of x , whereas lround() returns long , and llround() returns long long .
nearbyint(x)
Returns the integral value nearest to x as a floating-point type. The current rounding mode is used: see round_style in the section on arithmetic type properties later in this chapter.
rint(x)
lrint(x)
llrint(x)
Returns the integral value nearest to x , using the current rounding mode. The return type of rint() is based as usual on the type of x , whereas lrint() returns long , and llrint() returns long long .
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «C++ Standard Library Quick Reference»

Look at similar books to C++ Standard Library Quick Reference. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «C++ Standard Library Quick Reference»

Discussion, reviews of the book C++ Standard Library Quick Reference and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.