Int32 Struktura
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Představuje 32bitové celé číslo se signoum sadou.
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
- Dědičnost
- Atributy
- Implementuje
-
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>
Poznámky
Další informace o tomto rozhraní API najdete v tématu Doplňkové poznámky k rozhraní API pro Int32.
Pole
MaxValue |
Představuje největší možnou hodnotu objektu Int32. Toto pole je konstantní. |
MinValue |
Představuje nejmenší možnou hodnotu .Int32 Toto pole je konstantní. |
Metody
Abs(Int32) |
Vypočítá absolutní hodnotu. |
Clamp(Int32, Int32, Int32) |
Upne hodnotu na inkluzivní minimální a maximální hodnotu. |
CompareTo(Int32) |
Porovná tuto instanci se zadaným 32bitovým znaménkem integer a vrátí indikaci jejich relativních hodnot. |
CompareTo(Object) |
Porovná tuto instanci se zadaným objektem a vrací údaj o jejich relativních hodnotách. |
CopySign(Int32, Int32) |
Zkopíruje znaménko hodnoty na znaménko jiné hodnoty. |
CreateChecked<TOther>(TOther) |
Vytvoří instanci aktuálního typu z hodnoty a vyvolá výjimku přetečení pro všechny hodnoty, které spadají mimo reprezentovatelný rozsah aktuálního typu. |
CreateSaturating<TOther>(TOther) |
Vytvoří instanci aktuálního typu z hodnoty a nasytí všechny hodnoty, které spadají mimo reprezentovatelný rozsah aktuálního typu. |
CreateTruncating<TOther>(TOther) |
Vytvoří instanci aktuálního typu z hodnoty a zkrátí všechny hodnoty, které spadají mimo reprezentovatelný rozsah aktuálního typu. |
DivRem(Int32, Int32) |
Vypočítá podíl a zbytek dvou hodnot. |
Equals(Int32) |
Vrátí hodnotu označující, zda se tato instance rovná zadané Int32 hodnotě. |
Equals(Object) |
Vrací hodnotu, která určuje, zda je tato instance rovna zadanému objektu. |
GetHashCode() |
Vrátí hodnotu hash pro tuto instanci. |
GetTypeCode() | |
IsEvenInteger(Int32) |
Určuje, zda hodnota představuje sudé číslo. |
IsNegative(Int32) |
Určuje, jestli je hodnota záporná. |
IsOddInteger(Int32) |
Určuje, zda hodnota představuje liché celočíselné číslo. |
IsPositive(Int32) |
Určuje, jestli je hodnota kladná. |
IsPow2(Int32) |
Určuje, zda je hodnota mocnina dva. |
LeadingZeroCount(Int32) |
Vypočítá počet počátečních nul v hodnotě. |
Log2(Int32) |
Vypočítá log2 hodnoty. |
Max(Int32, Int32) |
Porovná dvě hodnoty pro výpočet, který je větší. |
MaxMagnitude(Int32, Int32) |
Porovná dvě hodnoty pro výpočet, který je větší. |
Min(Int32, Int32) |
Porovná dvě hodnoty s výpočtem, který je menší. |
MinMagnitude(Int32, Int32) |
Porovná dvě hodnoty s výpočtem, který je menší. |
Parse(ReadOnlySpan<Byte>, IFormatProvider) |
Parsuje rozsah znaků UTF-8 na hodnotu. |
Parse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider) |
Parsuje rozsah znaků UTF-8 na hodnotu. |
Parse(ReadOnlySpan<Char>, IFormatProvider) |
Parsuje rozsah znaků na hodnotu. |
Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider) |
Převede reprezentaci rozsahu čísla v zadaném stylu a formátu specifickém pro jazykovou verzi na jeho 32bitový celočíselný ekvivalent. |
Parse(String) |
Převádí řetězcové vyjádření čísla na jeho ekvivalent v podobě 32bitového celého čísla se znaménkem. |
Parse(String, IFormatProvider) |
Převede řetězcovou reprezentaci čísla v zadaném formátu specifickém pro jazykovou verzi na jeho 32bitový celočíselný ekvivalent. |
Parse(String, NumberStyles) |
Převede řetězcové vyjádření čísla v zadaném stylu na jeho 32bitové celočíselné číslo. |
Parse(String, NumberStyles, IFormatProvider) |
Převede řetězcovou reprezentaci čísla v zadaném stylu a formátu specifickém pro jazykovou verzi na jeho 32bitový celočíselný ekvivalent. |
PopCount(Int32) |
Vypočítá počet bitů, které jsou nastaveny v hodnotě. |
RotateLeft(Int32, Int32) |
Otočí hodnotu, která zbyla o danou částku. |
RotateRight(Int32, Int32) |
Otočí hodnotu doprava o danou částku. |
Sign(Int32) |
Vypočítá znaménko hodnoty. |
ToString() |
Převádí číselnou hodnotu této instance na její ekvivalentní řetězcové vyjádření. |
ToString(IFormatProvider) |
Převádí číselnou hodnotu této instance na její ekvivalentní řetězcové vyjádření pomocí určených informací o formátování specifických pro jazykovou verzi. |
ToString(String) |
Převádí číselnou hodnotu této instance na její ekvivalentní řetězcové vyjádření pomocí určeného formátu. |
ToString(String, IFormatProvider) |
Převádí číselnou hodnotu této instance na její ekvivalentní řetězcové vyjádření pomocí určeného formátu a informací o formátování specifických pro jazykovou verzi. |
TrailingZeroCount(Int32) |
Vypočítá počet koncových nul v hodnotě. |
TryFormat(Span<Byte>, Int32, ReadOnlySpan<Char>, IFormatProvider) |
Pokusí se naformátovat hodnotu aktuální instance jako UTF-8 do zadaného rozsahu bajtů. |
TryFormat(Span<Char>, Int32, ReadOnlySpan<Char>, IFormatProvider) |
Pokusí se naformátovat hodnotu aktuální instance celočíselného čísla do zadaného rozsahu znaků. |
TryParse(ReadOnlySpan<Byte>, IFormatProvider, Int32) |
Pokusí se parsovat rozsah znaků UTF-8 na hodnotu. |
TryParse(ReadOnlySpan<Byte>, Int32) |
Pokusí se převést rozsah znaků UTF-8 obsahující řetězcovou reprezentaci čísla na jeho 32bitový celočíselný ekvivalent se znaménkem. |
TryParse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider, Int32) |
Pokusí se parsovat rozsah znaků UTF-8 na hodnotu. |
TryParse(ReadOnlySpan<Char>, IFormatProvider, Int32) |
Pokusí se parsovat rozsah znaků na hodnotu. |
TryParse(ReadOnlySpan<Char>, Int32) |
Převede reprezentaci rozsahu čísla v zadaném stylu a formátu specifickém pro jazykovou verzi na jeho 32bitový celočíselný ekvivalent se signýmým kódem. Návratová hodnota označuje, jestli převod proběhl úspěšně. |
TryParse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider, Int32) |
Převede reprezentaci rozsahu čísla v zadaném stylu a formátu specifickém pro jazykovou verzi na jeho 32bitový celočíselný ekvivalent se signýmým kódem. Návratová hodnota označuje, jestli převod proběhl úspěšně. |
TryParse(String, IFormatProvider, Int32) |
Pokusí se parsovat řetězec na hodnotu. |
TryParse(String, Int32) |
Převádí řetězcové vyjádření čísla na jeho ekvivalent v podobě 32bitového celého čísla se znaménkem. Návratová hodnota označuje, jestli převod proběhl úspěšně. |
TryParse(String, NumberStyles, IFormatProvider, Int32) |
Převede řetězcovou reprezentaci čísla v zadaném stylu a formátu specifickém pro jazykovou verzi na jeho 32bitový celočíselný ekvivalent se znaky. Návratová hodnota označuje, jestli převod proběhl úspěšně. |
Explicitní implementace rozhraní
Platí pro
Bezpečný přístup z více vláken
Všechny členy tohoto typu jsou zabezpečeny pro přístup z více vláken. Členy, které patrně upravují stav instance, ve skutečnosti vrací novou instanci inicializovanou s použitím nové hodnoty. Jako u jakéhokoli typu, čtení a zápis do sdílené proměnné, která obsahuje instanci tohoto typu, musí být chráněn zámkem, který zaručí bezpečný přístup z více vláken.
Viz také
Váš názor
https://aka.ms/ContentUserFeedback.
Připravujeme: V průběhu roku 2024 budeme postupně vyřazovat problémy z GitHub coby mechanismus zpětné vazby pro obsah a nahrazovat ho novým systémem zpětné vazby. Další informace naleznete v tématu:Odeslat a zobrazit názory pro