Yes, floats can be compared for equality, it just doesn't give exactly the answer one would expect, e.g.:

```python
>>> 1 + 0.1 - 1 == 0.1
False
```

However, in this case this optimisation is only valid when `shape` is exactly `1`, i.e. it will be triggered by a call like `Gamma::new(1.0, 2.0)`, so this is fine (doing an approximation like `if (shape - 1.0).abs() < 1e-5` would mean that `Gamma::new(1.000001, 1.0)` does not have that distribution, i.e. it is incorrect).