Replacement for @raoulb pr#914

See #914

ToDo:
- [x] tests
- [x] final rebase
> How about "and for some instances when the result is a rational multiple of pi".

Done