“Paper late!” cried a voice in the crowd,
“Old man dies!” The note he left was signed,
‘Old Kiczales’ - it seems he’s drowned!
# .github/workflows/publish.yml | |
name: Generate a build and push to another branch | |
on: | |
push: | |
branches: | |
- master # Remove this line if your primary branch is "main" | |
- main # Remove this line if your primary branch is "master" | |
jobs: |
There are plenty of tutorials online on how to install clang on windows with visual studioIDE and MinGW. However, there are none on clang with visual studio build tools.
- 64-bit Windows 7 SP1 or newer with the latest updates installed
- 6 GB of free space on the partition where Windows is installed
- internet connection (for installation only)
%VS2017BuildToolsDir%
= installation directory of VS 2017 build tools
What is strict aliasing? First we will describe what is aliasing and then we can learn what being strict about it means.
In C and C++ aliasing has to do with what expression types we are allowed to access stored values through. In both C and C++ the standard specifies which expression types are allowed to alias which types. The compiler and optimizer are allowed to assume we follow the aliasing rules strictly, hence the term strict aliasing rule. If we attempt to access a value using a type not allowed it is classified as undefined behavior(UB). Once we have undefined behavior all bets are off, the results of our program are no longer reliable.
Unfortunately with strict aliasing violations, we will often obtain the results we expect, leaving the possibility the a future version of a compiler with a new optimization will break code we th
using System; | |
using System.Numerics; | |
namespace Common | |
{ | |
/// <summary> | |
/// Arbitrary precision decimal. | |
/// All operations are exact, except for division. Division never determines more digits than the given precision. | |
/// Source: https://gist.github.com/JcBernack/0b4eef59ca97ee931a2f45542b9ff06d | |
/// Based on https://stackoverflow.com/a/4524254 |
int doubler(int x) { | |
return 2 * x; | |
} |
/// <summary> | |
/// Fast exponential approximation. | |
/// </summary> | |
/// <remarks> | |
/// Based on "A Fast, Compact Approximation of the Exponential Function" by Nicol N.Schraudolph (1999) | |
/// <code>e^x ~ a*x + b | |
/// a = 2 ^ (mantissa bits) / ln(2) ~ 12102203 | |
/// b = (exponent bias) * 2^(mantissa bits) ~ 1065353216</code> | |
/// </remarks> | |
/// <param name="x">A number specifying a power.</param> |