Int32 構造体
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
32 ビット符号付き整数を表します。
public value class int : IComparable, IComparable<int>, IConvertible, IEquatable<int>, IFormattable
public value class int : IComparable, IComparable<int>, IConvertible, IEquatable<int>, ISpanFormattable
public value class int : IComparable<int>, IConvertible, IEquatable<int>, IParsable<int>, ISpanParsable<int>, System::Numerics::IAdditionOperators<int, int, int>, System::Numerics::IAdditiveIdentity<int, int>, System::Numerics::IBinaryInteger<int>, System::Numerics::IBinaryNumber<int>, System::Numerics::IBitwiseOperators<int, int, int>, System::Numerics::IComparisonOperators<int, int, bool>, System::Numerics::IDecrementOperators<int>, System::Numerics::IDivisionOperators<int, int, int>, System::Numerics::IEqualityOperators<int, int, bool>, System::Numerics::IIncrementOperators<int>, System::Numerics::IMinMaxValue<int>, System::Numerics::IModulusOperators<int, int, int>, System::Numerics::IMultiplicativeIdentity<int, int>, System::Numerics::IMultiplyOperators<int, int, int>, System::Numerics::INumber<int>, System::Numerics::INumberBase<int>, System::Numerics::IShiftOperators<int, int, int>, System::Numerics::ISignedNumber<int>, System::Numerics::ISubtractionOperators<int, int, int>, System::Numerics::IUnaryNegationOperators<int, int>, System::Numerics::IUnaryPlusOperators<int, int>
public value class int : IComparable<int>, IConvertible, IEquatable<int>, IParsable<int>, ISpanParsable<int>, IUtf8SpanParsable<int>, System::Numerics::IAdditionOperators<int, int, int>, System::Numerics::IAdditiveIdentity<int, int>, System::Numerics::IBinaryInteger<int>, System::Numerics::IBinaryNumber<int>, System::Numerics::IBitwiseOperators<int, int, int>, System::Numerics::IComparisonOperators<int, int, bool>, System::Numerics::IDecrementOperators<int>, System::Numerics::IDivisionOperators<int, int, int>, System::Numerics::IEqualityOperators<int, int, bool>, System::Numerics::IIncrementOperators<int>, System::Numerics::IMinMaxValue<int>, System::Numerics::IModulusOperators<int, int, int>, System::Numerics::IMultiplicativeIdentity<int, int>, System::Numerics::IMultiplyOperators<int, int, int>, System::Numerics::INumber<int>, System::Numerics::INumberBase<int>, System::Numerics::IShiftOperators<int, int, int>, System::Numerics::ISignedNumber<int>, System::Numerics::ISubtractionOperators<int, int, int>, System::Numerics::IUnaryNegationOperators<int, int>, System::Numerics::IUnaryPlusOperators<int, int>
public value class int : IComparable, IConvertible, IFormattable
public value class int : IComparable, IComparable<int>, IEquatable<int>, IFormattable
public struct Int32 : IComparable, IComparable<int>, IConvertible, IEquatable<int>, IFormattable
public readonly struct Int32 : IComparable, IComparable<int>, IConvertible, IEquatable<int>, IFormattable
public readonly struct Int32 : IComparable, IComparable<int>, IConvertible, IEquatable<int>, ISpanFormattable
public readonly struct Int32 : IComparable<int>, IConvertible, IEquatable<int>, IParsable<int>, ISpanParsable<int>, System.Numerics.IAdditionOperators<int,int,int>, System.Numerics.IAdditiveIdentity<int,int>, System.Numerics.IBinaryInteger<int>, System.Numerics.IBinaryNumber<int>, System.Numerics.IBitwiseOperators<int,int,int>, System.Numerics.IComparisonOperators<int,int,bool>, System.Numerics.IDecrementOperators<int>, System.Numerics.IDivisionOperators<int,int,int>, System.Numerics.IEqualityOperators<int,int,bool>, System.Numerics.IIncrementOperators<int>, System.Numerics.IMinMaxValue<int>, System.Numerics.IModulusOperators<int,int,int>, System.Numerics.IMultiplicativeIdentity<int,int>, System.Numerics.IMultiplyOperators<int,int,int>, System.Numerics.INumber<int>, System.Numerics.INumberBase<int>, System.Numerics.IShiftOperators<int,int,int>, System.Numerics.ISignedNumber<int>, System.Numerics.ISubtractionOperators<int,int,int>, System.Numerics.IUnaryNegationOperators<int,int>, System.Numerics.IUnaryPlusOperators<int,int>
public readonly struct Int32 : IComparable<int>, IConvertible, IEquatable<int>, IParsable<int>, ISpanParsable<int>, IUtf8SpanParsable<int>, System.Numerics.IAdditionOperators<int,int,int>, System.Numerics.IAdditiveIdentity<int,int>, System.Numerics.IBinaryInteger<int>, System.Numerics.IBinaryNumber<int>, System.Numerics.IBitwiseOperators<int,int,int>, System.Numerics.IComparisonOperators<int,int,bool>, System.Numerics.IDecrementOperators<int>, System.Numerics.IDivisionOperators<int,int,int>, System.Numerics.IEqualityOperators<int,int,bool>, System.Numerics.IIncrementOperators<int>, System.Numerics.IMinMaxValue<int>, System.Numerics.IModulusOperators<int,int,int>, System.Numerics.IMultiplicativeIdentity<int,int>, System.Numerics.IMultiplyOperators<int,int,int>, System.Numerics.INumber<int>, System.Numerics.INumberBase<int>, System.Numerics.IShiftOperators<int,int,int>, System.Numerics.ISignedNumber<int>, System.Numerics.ISubtractionOperators<int,int,int>, System.Numerics.IUnaryNegationOperators<int,int>, System.Numerics.IUnaryPlusOperators<int,int>
[System.Serializable]
public struct Int32 : IComparable, IConvertible, IFormattable
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public struct Int32 : IComparable, IComparable<int>, IConvertible, IEquatable<int>, IFormattable
public struct Int32 : IComparable, IComparable<int>, IEquatable<int>, IFormattable
type int = struct
interface IConvertible
interface IFormattable
type int = struct
interface IConvertible
interface ISpanFormattable
interface IFormattable
type int = struct
interface IConvertible
interface IFormattable
interface IParsable<int>
interface ISpanFormattable
interface ISpanParsable<int>
interface IAdditionOperators<int, int, int>
interface IAdditiveIdentity<int, int>
interface IBinaryInteger<int>
interface IBinaryNumber<int>
interface IBitwiseOperators<int, int, int>
interface IComparisonOperators<int, int, bool>
interface IEqualityOperators<int, int, bool>
interface IDecrementOperators<int>
interface IDivisionOperators<int, int, int>
interface IIncrementOperators<int>
interface IModulusOperators<int, int, int>
interface IMultiplicativeIdentity<int, int>
interface IMultiplyOperators<int, int, int>
interface INumber<int>
interface INumberBase<int>
interface ISubtractionOperators<int, int, int>
interface IUnaryNegationOperators<int, int>
interface IUnaryPlusOperators<int, int>
interface IShiftOperators<int, int, int>
interface IMinMaxValue<int>
interface ISignedNumber<int>
type int = struct
interface IConvertible
interface IFormattable
interface IParsable<int>
interface ISpanFormattable
interface ISpanParsable<int>
interface IAdditionOperators<int, int, int>
interface IAdditiveIdentity<int, int>
interface IBinaryInteger<int>
interface IBinaryNumber<int>
interface IBitwiseOperators<int, int, int>
interface IComparisonOperators<int, int, bool>
interface IEqualityOperators<int, int, bool>
interface IDecrementOperators<int>
interface IDivisionOperators<int, int, int>
interface IIncrementOperators<int>
interface IModulusOperators<int, int, int>
interface IMultiplicativeIdentity<int, int>
interface IMultiplyOperators<int, int, int>
interface INumber<int>
interface INumberBase<int>
interface ISubtractionOperators<int, int, int>
interface IUnaryNegationOperators<int, int>
interface IUnaryPlusOperators<int, int>
interface IUtf8SpanFormattable
interface IUtf8SpanParsable<int>
interface IShiftOperators<int, int, int>
interface IMinMaxValue<int>
interface ISignedNumber<int>
type int = struct
interface IConvertible
interface IFormattable
interface IParsable<int>
interface ISpanFormattable
interface ISpanParsable<int>
interface IUtf8SpanFormattable
interface IUtf8SpanParsable<int>
interface IAdditionOperators<int, int, int>
interface IAdditiveIdentity<int, int>
interface IBinaryInteger<int>
interface IBinaryNumber<int>
interface IBitwiseOperators<int, int, int>
interface IComparisonOperators<int, int, bool>
interface IEqualityOperators<int, int, bool>
interface IDecrementOperators<int>
interface IDivisionOperators<int, int, int>
interface IIncrementOperators<int>
interface IModulusOperators<int, int, int>
interface IMultiplicativeIdentity<int, int>
interface IMultiplyOperators<int, int, int>
interface INumber<int>
interface INumberBase<int>
interface ISubtractionOperators<int, int, int>
interface IUnaryNegationOperators<int, int>
interface IUnaryPlusOperators<int, int>
interface IShiftOperators<int, int, int>
interface IMinMaxValue<int>
interface ISignedNumber<int>
[<System.Serializable>]
type int = struct
interface IFormattable
interface IConvertible
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type int = struct
interface IFormattable
interface IConvertible
type int = struct
interface IFormattable
Public Structure Int32
Implements IComparable, IComparable(Of Integer), IConvertible, IEquatable(Of Integer), IFormattable
Public Structure Int32
Implements IComparable, IComparable(Of Integer), IConvertible, IEquatable(Of Integer), ISpanFormattable
Public Structure Int32
Implements IAdditionOperators(Of Integer, Integer, Integer), IAdditiveIdentity(Of Integer, Integer), IBinaryInteger(Of Integer), IBinaryNumber(Of Integer), IBitwiseOperators(Of Integer, Integer, Integer), IComparable(Of Integer), IComparisonOperators(Of Integer, Integer, Boolean), IConvertible, IDecrementOperators(Of Integer), IDivisionOperators(Of Integer, Integer, Integer), IEqualityOperators(Of Integer, Integer, Boolean), IEquatable(Of Integer), IIncrementOperators(Of Integer), IMinMaxValue(Of Integer), IModulusOperators(Of Integer, Integer, Integer), IMultiplicativeIdentity(Of Integer, Integer), IMultiplyOperators(Of Integer, Integer, Integer), INumber(Of Integer), INumberBase(Of Integer), IParsable(Of Integer), IShiftOperators(Of Integer, Integer, Integer), ISignedNumber(Of Integer), ISpanParsable(Of Integer), ISubtractionOperators(Of Integer, Integer, Integer), IUnaryNegationOperators(Of Integer, Integer), IUnaryPlusOperators(Of Integer, Integer)
Public Structure Int32
Implements IAdditionOperators(Of Integer, Integer, Integer), IAdditiveIdentity(Of Integer, Integer), IBinaryInteger(Of Integer), IBinaryNumber(Of Integer), IBitwiseOperators(Of Integer, Integer, Integer), IComparable(Of Integer), IComparisonOperators(Of Integer, Integer, Boolean), IConvertible, IDecrementOperators(Of Integer), IDivisionOperators(Of Integer, Integer, Integer), IEqualityOperators(Of Integer, Integer, Boolean), IEquatable(Of Integer), IIncrementOperators(Of Integer), IMinMaxValue(Of Integer), IModulusOperators(Of Integer, Integer, Integer), IMultiplicativeIdentity(Of Integer, Integer), IMultiplyOperators(Of Integer, Integer, Integer), INumber(Of Integer), INumberBase(Of Integer), IParsable(Of Integer), IShiftOperators(Of Integer, Integer, Integer), ISignedNumber(Of Integer), ISpanParsable(Of Integer), ISubtractionOperators(Of Integer, Integer, Integer), IUnaryNegationOperators(Of Integer, Integer), IUnaryPlusOperators(Of Integer, Integer), IUtf8SpanParsable(Of Integer)
Public Structure Int32
Implements IComparable, IConvertible, IFormattable
Public Structure Int32
Implements IComparable, IComparable(Of Integer), IEquatable(Of Integer), IFormattable
- 継承
- 属性
- 実装
-
IComparable IComparable<Int32> IConvertible IEquatable<Int32> IFormattable ISpanFormattable IComparable<TSelf> IEquatable<TSelf> IParsable<Int32> IParsable<TSelf> ISpanParsable<Int32> ISpanParsable<TSelf> IAdditionOperators<Int32,Int32,Int32> IAdditionOperators<TSelf,TSelf,TSelf> IAdditiveIdentity<Int32,Int32> IAdditiveIdentity<TSelf,TSelf> IBinaryInteger<Int32> IBinaryNumber<Int32> IBinaryNumber<TSelf> IBitwiseOperators<Int32,Int32,Int32> IBitwiseOperators<TSelf,TSelf,TSelf> IComparisonOperators<Int32,Int32,Boolean> IComparisonOperators<TSelf,TSelf,Boolean> IDecrementOperators<Int32> IDecrementOperators<TSelf> IDivisionOperators<Int32,Int32,Int32> IDivisionOperators<TSelf,TSelf,TSelf> IEqualityOperators<Int32,Int32,Boolean> IEqualityOperators<TSelf,TOther,TResult> IEqualityOperators<TSelf,TSelf,Boolean> IIncrementOperators<Int32> IIncrementOperators<TSelf> IMinMaxValue<Int32> IModulusOperators<Int32,Int32,Int32> IModulusOperators<TSelf,TSelf,TSelf> IMultiplicativeIdentity<Int32,Int32> IMultiplicativeIdentity<TSelf,TSelf> IMultiplyOperators<Int32,Int32,Int32> IMultiplyOperators<TSelf,TSelf,TSelf> INumber<Int32> INumber<TSelf> INumberBase<Int32> INumberBase<TSelf> IShiftOperators<Int32,Int32,Int32> IShiftOperators<TSelf,Int32,TSelf> ISignedNumber<Int32> ISubtractionOperators<Int32,Int32,Int32> ISubtractionOperators<TSelf,TSelf,TSelf> IUnaryNegationOperators<Int32,Int32> IUnaryNegationOperators<TSelf,TSelf> IUnaryPlusOperators<Int32,Int32> IUnaryPlusOperators<TSelf,TSelf> IUtf8SpanFormattable IUtf8SpanParsable<Int32> IUtf8SpanParsable<TSelf>
注釈
この API の詳細については、「 Int32 の補足 API 解説」を参照してください。
フィールド
MaxValue |
Int32 の最大有効値を表します。 このフィールドは定数です。 |
MinValue |
Int32 の最小有効値を表します。 このフィールドは定数です。 |
メソッド
Abs(Int32) |
値の絶対を計算します。 |
BigMul(Int32, Int32) |
32 ビット符号付き整数を表します。 |
Clamp(Int32, Int32, Int32) |
値を包括的な最小値と最大値にクランプします。 |
CompareTo(Int32) |
指定した 32 ビット符号付き整数とこのインスタンスを比較し、これらの相対値を示す値を返します。 |
CompareTo(Object) |
指定したオブジェクトとこのインスタンスを比較し、これらの相対値を示す値を返します。 |
CopySign(Int32, Int32) |
値の符号を別の値の符号にコピーします。 |
CreateChecked<TOther>(TOther) |
現在の型のインスタンスを値から作成し、現在の型の表現可能な範囲外にある値に対してオーバーフロー例外をスローします。 |
CreateSaturating<TOther>(TOther) |
現在の型のインスタンスを値から作成し、現在の型の表現可能な範囲外の値を飽和させます。 |
CreateTruncating<TOther>(TOther) |
現在の型のインスタンスを値から作成し、現在の型の表現可能な範囲外の値を切り捨てます。 |
DivRem(Int32, Int32) |
2 つの値の商と剰余を計算します。 |
Equals(Int32) |
このインスタンスが指定した Int32 値に等しいかどうかを示す値を返します。 |
Equals(Object) |
このインスタンスが指定されたオブジェクトに等しいかどうかを示す値を返します。 |
GetHashCode() |
このインスタンスのハッシュ コードを返します。 |
GetTypeCode() | |
IsEvenInteger(Int32) |
値が偶数の整数を表すかどうかを判断します。 |
IsNegative(Int32) |
値が負かどうかを判断します。 |
IsOddInteger(Int32) |
値が奇数の整数を表すかどうかを判断します。 |
IsPositive(Int32) |
値が正かどうかを判断します。 |
IsPow2(Int32) |
値が 2 の累乗であるかどうかを判断します。 |
LeadingZeroCount(Int32) |
値の先頭の 0 の数を計算します。 |
Log2(Int32) |
値の log2 を計算します。 |
Max(Int32, Int32) |
2 つの値を比較して、より大きいコンピューティングを行います。 |
MaxMagnitude(Int32, Int32) |
2 つの値を比較して、より大きいコンピューティングを行います。 |
Min(Int32, Int32) |
2 つの値を比較して、より小さいコンピューティングを行います。 |
MinMagnitude(Int32, Int32) |
2 つの値を比較して、より小さいコンピューティングを行います。 |
Parse(ReadOnlySpan<Byte>, IFormatProvider) |
UTF-8 文字のスパンを値に解析します。 |
Parse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider) |
UTF-8 文字のスパンを値に解析します。 |
Parse(ReadOnlySpan<Char>, IFormatProvider) |
文字のスパンを値に解析します。 |
Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider) |
指定したスタイルおよびカルチャに固有の書式による数値のスパン表現を、等価の 32 ビット符号付き整数に変換します。 |
Parse(String) |
数値の文字列形式を、それと等価な 32 ビット符号付き整数に変換します。 |
Parse(String, IFormatProvider) |
指定したカルチャに固有の書式による数値の文字列形式を、それと等価な 32 ビット符号付き整数に変換します。 |
Parse(String, NumberStyles) |
指定したスタイルの数値の文字列形式を、それと等しい 32 ビット符号付き整数に変換します。 |
Parse(String, NumberStyles, IFormatProvider) |
指定したスタイルおよびカルチャに固有の書式による数値の文字列形式を、それと等価の 32 ビット符号付き整数に変換します。 |
PopCount(Int32) |
値に設定されているビット数を計算します。 |
RotateLeft(Int32, Int32) |
指定した量だけ値を左に回転します。 |
RotateRight(Int32, Int32) |
指定した量だけ値を右方向に回転します。 |
Sign(Int32) |
値の符号を計算します。 |
ToString() |
このインスタンスの数値を、それと等価な文字列形式に変換します。 |
ToString(IFormatProvider) |
このインスタンスの数値を、指定したカルチャ固有の書式情報を使用して、それと等価な文字列形式に変換します。 |
ToString(String) |
指定した書式を使用して、このインスタンスの数値を、それと等価な文字列形式に変換します。 |
ToString(String, IFormatProvider) |
このインスタンスの数値を、指定した書式およびカルチャ固有の書式情報を使用して、それと等価な文字列形式に変換します。 |
TrailingZeroCount(Int32) |
値の末尾の 0 の数を計算します。 |
TryFormat(Span<Byte>, Int32, ReadOnlySpan<Char>, IFormatProvider) |
現在のインスタンスの値を UTF-8 として指定されたバイトスパンに書式設定しようとします。 |
TryFormat(Span<Char>, Int32, ReadOnlySpan<Char>, IFormatProvider) |
現在の整数値インスタンスの値の、指定した文字スパンへの書式設定を試みます。 |
TryParse(ReadOnlySpan<Byte>, IFormatProvider, Int32) |
UTF-8 文字のスパンを値に解析しようとします。 |
TryParse(ReadOnlySpan<Byte>, Int32) |
数値の文字列表現を含む UTF-8 文字範囲を、等価の 32 ビット符号付き整数に変換しようとします。 |
TryParse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider, Int32) |
UTF-8 文字のスパンを値に解析しようとします。 |
TryParse(ReadOnlySpan<Char>, IFormatProvider, Int32) |
文字のスパンを値に解析しようとします。 |
TryParse(ReadOnlySpan<Char>, Int32) |
指定したスタイルおよびカルチャに固有の書式による数値のスパン表現を、等価の 32 ビット符号付き整数に変換します。 戻り値は、変換が成功したかどうかを示します。 |
TryParse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider, Int32) |
指定したスタイルおよびカルチャに固有の書式による数値のスパン表現を、等価の 32 ビット符号付き整数に変換します。 戻り値は、変換が成功したかどうかを示します。 |
TryParse(String, IFormatProvider, Int32) |
文字列を値に解析しようとします。 |
TryParse(String, Int32) |
数値の文字列形式を、それと等価な 32 ビット符号付き整数に変換します。 戻り値は、変換が成功したかどうかを示します。 |
TryParse(String, NumberStyles, IFormatProvider, Int32) |
指定したスタイルおよびカルチャに固有の書式による数値の文字列形式を、それと等価の 32 ビット符号付き整数に変換します。 戻り値は、変換が成功したかどうかを示します。 |
明示的なインターフェイスの実装
適用対象
スレッド セーフ
この型のすべてのメンバーはスレッド セーフです。 インスタンスの状態を変更するように見えるメンバーは、実際には新しい値で初期化された新しいインスタンスを返します。 他の型と同様に、この型のインスタンスを含む共有変数の読み取りと書き込みは、スレッドの安全性を保証するためにロックによって保護する必要があります。
こちらもご覧ください
.NET
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示