Decimal32, Decimal64, and Decimal128 Design Approach

init(stringLiteral:) is an initializer magically called when a type conforming to ExpressibleByStringLiteral is initialized from a string literal; it is not meant to be called directly.

An API with an additional argument as here would never be called magically, and by analogy should never be called directly, so...


The convention is that to isn't used for adding.

The convention is multiplied(by:) and divided(by:).

Yes.

Either "-ed" or "-ing" is used to indicate a non-mutating operation; which one is used depends on English grammar. Prefer "-ed" if both work. If neither work, the fallback is the "form" convention that no one likes. In this case, no innovation is required as all of the APIs have been settled previously (see SE-0067).

2 Likes

Thanks @xwu for the insight. I'll remove this from the public interface.