Instance Property インスタンスプロパティ

magnitude

The magnitude of this value. この値の規模。

Declaration 宣言

var magnitude: UInt8 { get }

Discussion 解説

Every unsigned integer is its own magnitude, so for any value x, x == x.magnitude. すべての符号なし整数は、それ自身が規模(magnitude)です、それで何らかの値xにとって、x == x.magnitudeです。

The global abs(_:) function provides more familiar syntax when you need to find an absolute value. In addition, because abs(_:) always returns a value of the same type, even in a generic context, using the function instead of the magnitude property is encouraged. グローバルabs(_:)関数は、あなたが絶対値を見つける必要がある時により親しみやすい構文を提供します。加えて、abs(_:)は常に同じ型の値を返すことから、総称体の文脈においてさえも、この関数をmagnitudeプロパティの代わりに使うことは推奨されます。