Playing War

War on Julia Playing real war is no fun the card game called War is1. It takes a while to play though so I thought how long would it at take on average. To do this I programmed war on Julia. Here is the julia notebook code/html view. On avrage it takes about $134$ turns but half the games take less than $100$ turns. Half can go one for a long time....

November 9, 2025 · 1 min · Markus A.G. Amano

Rational π

Going around the circle n times So I was thinking about going around the circle some integer number of times 1 or by some rational fraction of the circle. If you go around the circle $n$ times, where $n$ is an integer, you end up where you started 2. If you go a rational fraction of the circle, you do not end up back at the start after one move. To keep the math straightforward, let’s say we move by a rational number, $\rho \equiv a/b \in \mathbb{Q}$, where $a, b \in \mathbb{Z}$, and we move around the circle $\rho\pi$ radians....

November 7, 2025 · 3 min · Markus A.G. Amano

My Integer Doesn't fit

I was playing on my computer and accidentally tried this expression to see what the computer would output: julia> 9007199254740992.0 + 1.0 == 9007199254740992.0 The REPL output was: julia> 9007199254740992.0 + 1.0 == 9007199254740992.0 true This is obviously incorrect mathematically. However, this arbitrary number is the maximum integer that a 64-bit float can store. In Julia, this number can be found using the maxintfloat function with the Float64 type: julia> maxintfloat(Float64) + 1 == maxintfloat(Float64) true Interestingly enough, adding two “fixes” the comparison:...

July 18, 2025 · 1 min · Markus A.G. Amano