Backport of #349.
Ondrej: Was (#356), but I think that's a wrong issue.
First attempt at BF for 2028 and added better tests for scalarmath po…
fixed some style problems
Got rid of some white space in scalarmathmodule.c.src
(@ericfode --- I fixed the PR number that you backported in the PR description above.)
This looks good. Merging.