commit 77906b5f6b19ddb1f51da461b4a50d4284f2c0cf parent 0cfff02622134741fbe9e84fdad9a4e1b0505232 Author: thing1 <thing1@seacrossedlovers.xyz> Date: Mon, 6 Oct 2025 14:51:25 +0100 added notes from the 6th Diffstat:
| A | CS12020/06.10.25.md | | | 63 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| A | PH16210/06.10.25.md | | | 10 | ++++++++++ |
2 files changed, 73 insertions(+), 0 deletions(-)
diff --git a/CS12020/06.10.25.md b/CS12020/06.10.25.md @@ -0,0 +1,63 @@ +06/10/25 +======== + +Compound operators +------------------ + + x += 3 + x *= 3 + x -= 3 + x /= 3 + +Post increment +-------------- + + x++ + x-- + +When you say `y = x++` y is equ to x and x is equ to x + 1 + +Pre increment +------------- + + --x + ++x + +When you say `y = ++x` y is equ to x + 1 and x is equ to x + 1 + +Branching +--------- +Standard conditional + + if (x) { + f(); + } + else if (y) { + g(x); + } + else { + h(x); + } + +Switch statement + + switch (x) { + case 1: + f(x); + break; + case 2: + g(x); + break; + default: + h(x); + break; + } + +Ternary operator + + val = (x) ? f(x) : g(x); + +Comments +-------- +Multi line comments `/* stuff */` +Single line comments `// stuff` diff --git a/PH16210/06.10.25.md b/PH16210/06.10.25.md @@ -0,0 +1,10 @@ +06/10/25 +======== + +Rational function +----------------- +- functions of p()/q() are only valid if the coefficient of q is higher than that of p +- long division of polynomials is called Horner's method +- see FIG1 for info on rearranging partial fractions +- see FIG2 for info on partial fractions +