[Python-ideas] Fwd: Trigonometry in degrees

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Jun 12 02:40:23 EDT 2018


Tim Peters wrote:

> 1. Python's float "%" is unsuitable for argument reduction; e.g.,
> 
>  >>> -1e-14 % 360.0
> 360.0
> 
> `math.fmod` is suitable, because it's exact:
> 
>  >>> math.fmod(-1e-14, 360.0)
> -1e-14

So why doesn't float % use math.fmod?

-- 
Greg


More information about the Python-ideas mailing list