Swift で数学のススメ 〜 プログラミングと数学は同時に学べ17. protocol AdditiveGroup { // static var zero: Self { get } // static func + (a: Self, b: Self) -> Self // prefix static func - (x: Self) -> Self // } extension AdditiveGroup { static func -(a: Self, b: Self) -> Self { return (a + (-b)) // } } 18. protocol AdditiveGroup { // … } protocol Ring: AdditiveGroup { // static var identity: Self { get } // 1 static func *