diff --git a/Sources/Real/ElementaryFunctions.swift b/Sources/Real/ElementaryFunctions.swift index 1558f0f..5245a59 100644 --- a/Sources/Real/ElementaryFunctions.swift +++ b/Sources/Real/ElementaryFunctions.swift @@ -32,6 +32,9 @@ /// - Power and root functions: /// `pow`, `sqrt`, and `root`. /// +/// `ElementaryFunctions` conformance implies `AdditiveArithmetic`, so addition +/// and subtraction and the `.zero` property are also available. +/// /// There are two other protocols that you are more likely to want to use directly: /// /// `RealFunctions` refines `ElementaryFunctions` and includes diff --git a/Sources/Real/README.md b/Sources/Real/README.md index d17290c..2ec57dd 100644 --- a/Sources/Real/README.md +++ b/Sources/Real/README.md @@ -15,6 +15,8 @@ The module defines three protocols. The most general is `ElementaryFunctions`, w - Inverse hyperbolic functions: `acosh`, `asinh`, `atanh` - Power and root functions: `pow`, `sqrt`, `root` +`ElementaryFunctions` refines `AdditiveArithmetic`, and so also provides addition, subtraction, and the `.zero` property. + The `RealFunctions` protocol refines `ElementaryFunctions`, and adds operations that are difficult to define or implement over fields more general than the real numbers: - `atan2(y:x:)`, which computes `atan(y/x)` with sign chosen by the quadrant of the point `(x,y)` in the Cartesian plane. - `hypot`, which computes `sqrt(x*x + y*y)` without intermediate overflow or underflow.