Recalculate residual float value for affine after shrink #26

Switch to static casts for double values

Add unit tests that previously would have failed