|
| 1 | +approximation calculating a mathematical formula that returns a real value, |
| 2 | + to a given precision, for example, the exponential function's series |
| 3 | + gives back a better approximation of the value the more terms we |
| 4 | + calculate and add together |
| 5 | + floating point values can only store values in a specific number of bits, |
| 6 | + so really they just approximate real values |
| 7 | +Function a type inside our graphics library that can graph functions on a given range |
| 8 | + it accepts functions that return a double, and take a double argument |
| 9 | +scaling fitting data to fill the space defined by the axes, the data should not |
| 10 | + extend beyond the axes maximum value and beyond the minimum |
| 11 | +default argument initializers to parameters inside function declarations |
| 12 | + it allows us to call the function without supplying values to the already |
| 13 | + initialized arguments without the need of overloaded functions for each |
| 14 | + combination of default arguments |
| 15 | + default arguments can only be specified for trailing parameters |
| 16 | +lambda expression an unnamed (anonymous) function that can be defined exactly where it is needed |
| 17 | + a lambda expression consists of a lambda introducer: [], where we can define |
| 18 | + the variables inside the current, local scope to catch either by reference, |
| 19 | + or by value (copying); a parameter list: (), where we can declare parameters |
| 20 | + that callers will need to supply; an optional trailing return type: -> ; |
| 21 | + and the function body enclosed by curly braces: {} |
| 22 | + lambdas should be used when we need a function only once for a really specific problem, |
| 23 | + and their function bodies should not exceed a few lines, as that means that |
| 24 | + that computation should be in its own, named function |
| 25 | + the return type is optional, as most of the time the compiler can deduce it |
| 26 | + from the return statement |
| 27 | + lambda functions can be stored inside std::function objects or by using auto |
| 28 | + to define a variable |
| 29 | + lambdas act as function objects (functors), storing the caught objects as data members, |
| 30 | + and defining an overloaded function call operator (operator()) with our parameters |
| 31 | + and our return type |
| 32 | +screen layout the general layout of our window, where we will display our graphs |
| 33 | + designing the layout before writing code is essential for understanding it, |
| 34 | + defining symbolic constants also help to use the names of offsets and spacings |
| 35 | +Axis a type in our graphics library that allows us to place lines that represent axes, |
| 36 | + either inside the x or y direction, horizontal or vertical |
| 37 | + it also draws notches with the given distance from each other |
| 38 | +overflow computers store numbers inside a fixed number of bits, for example, integers are |
| 39 | + usually stored inside 32 bits, or 4 bytes |
| 40 | + when an integer holds the maximum value that it can hold (full of ones in binary), |
| 41 | + and we add one to it, it overflows, and resets to full zeroes in binary |
| 42 | + overflows are sneaky errors, without explicit checks for them, errors are not reported, |
| 43 | + which can mess up our computations |
0 commit comments