Implicit assumptions that Complex.RealType : BinaryFloatingPoint
NevinBR opened this issue · comments
Complex.RealType
is constrained to FloatingPoint
(among other things), but not BinaryFloatingPoint
. However, some of the comment text in ComplexModule/ElementaryFunctions.swift seems to implicitly assume binary-ness of RealType
:
a may be as small as 1/4, so we could lose a single bit to rounding
on this portion of the circle 1+x is always exact by Sterbenz' lemma
Sterbenz' lemma holds for floating-point numbers in any radix, not just radix-2. From this the other comment also follows for decimal (though I guess I could change "bit" to "digit" for clarity.)
Radix-independent proof of Sterbenz' lemma may be found on page 46 here: http://lyoncalcul.univ-lyon1.fr/ed/DOCS_2012-2013/FloatingPoint.pdf