SByte Struct
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents an 8-bit signed integer.
public value class System::SByte : IComparable, IComparable<System::SByte>, IConvertible, IEquatable<System::SByte>, IFormattable
public value class System::SByte : IComparable, IComparable<System::SByte>, IConvertible, IEquatable<System::SByte>, ISpanFormattable
public value class System::SByte : IComparable<System::SByte>, IConvertible, IEquatable<System::SByte>, IParsable<System::SByte>, ISpanParsable<System::SByte>, System::Numerics::IAdditionOperators<System::SByte, System::SByte, System::SByte>, System::Numerics::IAdditiveIdentity<System::SByte, System::SByte>, System::Numerics::IBinaryInteger<System::SByte>, System::Numerics::IBinaryNumber<System::SByte>, System::Numerics::IBitwiseOperators<System::SByte, System::SByte, System::SByte>, System::Numerics::IComparisonOperators<System::SByte, System::SByte, bool>, System::Numerics::IDecrementOperators<System::SByte>, System::Numerics::IDivisionOperators<System::SByte, System::SByte, System::SByte>, System::Numerics::IEqualityOperators<System::SByte, System::SByte, bool>, System::Numerics::IIncrementOperators<System::SByte>, System::Numerics::IMinMaxValue<System::SByte>, System::Numerics::IModulusOperators<System::SByte, System::SByte, System::SByte>, System::Numerics::IMultiplicativeIdentity<System::SByte, System::SByte>, System::Numerics::IMultiplyOperators<System::SByte, System::SByte, System::SByte>, System::Numerics::INumber<System::SByte>, System::Numerics::INumberBase<System::SByte>, System::Numerics::IShiftOperators<System::SByte, int, System::SByte>, System::Numerics::ISignedNumber<System::SByte>, System::Numerics::ISubtractionOperators<System::SByte, System::SByte, System::SByte>, System::Numerics::IUnaryNegationOperators<System::SByte, System::SByte>, System::Numerics::IUnaryPlusOperators<System::SByte, System::SByte>
public value class System::SByte : IComparable<System::SByte>, IConvertible, IEquatable<System::SByte>, IParsable<System::SByte>, ISpanParsable<System::SByte>, IUtf8SpanParsable<System::SByte>, System::Numerics::IAdditionOperators<System::SByte, System::SByte, System::SByte>, System::Numerics::IAdditiveIdentity<System::SByte, System::SByte>, System::Numerics::IBinaryInteger<System::SByte>, System::Numerics::IBinaryNumber<System::SByte>, System::Numerics::IBitwiseOperators<System::SByte, System::SByte, System::SByte>, System::Numerics::IComparisonOperators<System::SByte, System::SByte, bool>, System::Numerics::IDecrementOperators<System::SByte>, System::Numerics::IDivisionOperators<System::SByte, System::SByte, System::SByte>, System::Numerics::IEqualityOperators<System::SByte, System::SByte, bool>, System::Numerics::IIncrementOperators<System::SByte>, System::Numerics::IMinMaxValue<System::SByte>, System::Numerics::IModulusOperators<System::SByte, System::SByte, System::SByte>, System::Numerics::IMultiplicativeIdentity<System::SByte, System::SByte>, System::Numerics::IMultiplyOperators<System::SByte, System::SByte, System::SByte>, System::Numerics::INumber<System::SByte>, System::Numerics::INumberBase<System::SByte>, System::Numerics::IShiftOperators<System::SByte, int, System::SByte>, System::Numerics::ISignedNumber<System::SByte>, System::Numerics::ISubtractionOperators<System::SByte, System::SByte, System::SByte>, System::Numerics::IUnaryNegationOperators<System::SByte, System::SByte>, System::Numerics::IUnaryPlusOperators<System::SByte, System::SByte>
public value class System::SByte : IComparable, IConvertible, IFormattable
public value class System::SByte : IComparable, IComparable<System::SByte>, IEquatable<System::SByte>, IFormattable
[System.CLSCompliant(false)]
public struct SByte : IComparable, IComparable<sbyte>, IConvertible, IEquatable<sbyte>, IFormattable
[System.CLSCompliant(false)]
public readonly struct SByte : IComparable, IComparable<sbyte>, IConvertible, IEquatable<sbyte>, IFormattable
[System.CLSCompliant(false)]
public readonly struct SByte : IComparable, IComparable<sbyte>, IConvertible, IEquatable<sbyte>, ISpanFormattable
[System.CLSCompliant(false)]
public readonly struct SByte : IComparable<sbyte>, IConvertible, IEquatable<sbyte>, IParsable<sbyte>, ISpanParsable<sbyte>, System.Numerics.IAdditionOperators<sbyte,sbyte,sbyte>, System.Numerics.IAdditiveIdentity<sbyte,sbyte>, System.Numerics.IBinaryInteger<sbyte>, System.Numerics.IBinaryNumber<sbyte>, System.Numerics.IBitwiseOperators<sbyte,sbyte,sbyte>, System.Numerics.IComparisonOperators<sbyte,sbyte,bool>, System.Numerics.IDecrementOperators<sbyte>, System.Numerics.IDivisionOperators<sbyte,sbyte,sbyte>, System.Numerics.IEqualityOperators<sbyte,sbyte,bool>, System.Numerics.IIncrementOperators<sbyte>, System.Numerics.IMinMaxValue<sbyte>, System.Numerics.IModulusOperators<sbyte,sbyte,sbyte>, System.Numerics.IMultiplicativeIdentity<sbyte,sbyte>, System.Numerics.IMultiplyOperators<sbyte,sbyte,sbyte>, System.Numerics.INumber<sbyte>, System.Numerics.INumberBase<sbyte>, System.Numerics.IShiftOperators<sbyte,int,sbyte>, System.Numerics.ISignedNumber<sbyte>, System.Numerics.ISubtractionOperators<sbyte,sbyte,sbyte>, System.Numerics.IUnaryNegationOperators<sbyte,sbyte>, System.Numerics.IUnaryPlusOperators<sbyte,sbyte>
[System.CLSCompliant(false)]
public readonly struct SByte : IComparable<sbyte>, IConvertible, IEquatable<sbyte>, IParsable<sbyte>, ISpanParsable<sbyte>, IUtf8SpanParsable<sbyte>, System.Numerics.IAdditionOperators<sbyte,sbyte,sbyte>, System.Numerics.IAdditiveIdentity<sbyte,sbyte>, System.Numerics.IBinaryInteger<sbyte>, System.Numerics.IBinaryNumber<sbyte>, System.Numerics.IBitwiseOperators<sbyte,sbyte,sbyte>, System.Numerics.IComparisonOperators<sbyte,sbyte,bool>, System.Numerics.IDecrementOperators<sbyte>, System.Numerics.IDivisionOperators<sbyte,sbyte,sbyte>, System.Numerics.IEqualityOperators<sbyte,sbyte,bool>, System.Numerics.IIncrementOperators<sbyte>, System.Numerics.IMinMaxValue<sbyte>, System.Numerics.IModulusOperators<sbyte,sbyte,sbyte>, System.Numerics.IMultiplicativeIdentity<sbyte,sbyte>, System.Numerics.IMultiplyOperators<sbyte,sbyte,sbyte>, System.Numerics.INumber<sbyte>, System.Numerics.INumberBase<sbyte>, System.Numerics.IShiftOperators<sbyte,int,sbyte>, System.Numerics.ISignedNumber<sbyte>, System.Numerics.ISubtractionOperators<sbyte,sbyte,sbyte>, System.Numerics.IUnaryNegationOperators<sbyte,sbyte>, System.Numerics.IUnaryPlusOperators<sbyte,sbyte>
[System.CLSCompliant(false)]
[System.Serializable]
public struct SByte : IComparable, IConvertible, IFormattable
[System.CLSCompliant(false)]
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public struct SByte : IComparable, IComparable<sbyte>, IConvertible, IEquatable<sbyte>, IFormattable
[System.CLSCompliant(false)]
public struct SByte : IComparable, IComparable<sbyte>, IEquatable<sbyte>, IFormattable
[<System.CLSCompliant(false)>]
type sbyte = struct
interface IConvertible
interface IFormattable
[<System.CLSCompliant(false)>]
type sbyte = struct
interface IConvertible
interface ISpanFormattable
interface IFormattable
[<System.CLSCompliant(false)>]
type sbyte = struct
interface IConvertible
interface IFormattable
interface IParsable<sbyte>
interface ISpanFormattable
interface ISpanParsable<sbyte>
interface IAdditionOperators<sbyte, sbyte, sbyte>
interface IAdditiveIdentity<sbyte, sbyte>
interface IBinaryInteger<sbyte>
interface IBinaryNumber<sbyte>
interface IBitwiseOperators<sbyte, sbyte, sbyte>
interface IComparisonOperators<sbyte, sbyte, bool>
interface IEqualityOperators<sbyte, sbyte, bool>
interface IDecrementOperators<sbyte>
interface IDivisionOperators<sbyte, sbyte, sbyte>
interface IIncrementOperators<sbyte>
interface IModulusOperators<sbyte, sbyte, sbyte>
interface IMultiplicativeIdentity<sbyte, sbyte>
interface IMultiplyOperators<sbyte, sbyte, sbyte>
interface INumber<sbyte>
interface INumberBase<sbyte>
interface ISubtractionOperators<sbyte, sbyte, sbyte>
interface IUnaryNegationOperators<sbyte, sbyte>
interface IUnaryPlusOperators<sbyte, sbyte>
interface IShiftOperators<sbyte, int, sbyte>
interface IMinMaxValue<sbyte>
interface ISignedNumber<sbyte>
[<System.CLSCompliant(false)>]
type sbyte = struct
interface IConvertible
interface IFormattable
interface IParsable<sbyte>
interface ISpanFormattable
interface ISpanParsable<sbyte>
interface IAdditionOperators<sbyte, sbyte, sbyte>
interface IAdditiveIdentity<sbyte, sbyte>
interface IBinaryInteger<sbyte>
interface IBinaryNumber<sbyte>
interface IBitwiseOperators<sbyte, sbyte, sbyte>
interface IComparisonOperators<sbyte, sbyte, bool>
interface IEqualityOperators<sbyte, sbyte, bool>
interface IDecrementOperators<sbyte>
interface IDivisionOperators<sbyte, sbyte, sbyte>
interface IIncrementOperators<sbyte>
interface IModulusOperators<sbyte, sbyte, sbyte>
interface IMultiplicativeIdentity<sbyte, sbyte>
interface IMultiplyOperators<sbyte, sbyte, sbyte>
interface INumber<sbyte>
interface INumberBase<sbyte>
interface ISubtractionOperators<sbyte, sbyte, sbyte>
interface IUnaryNegationOperators<sbyte, sbyte>
interface IUnaryPlusOperators<sbyte, sbyte>
interface IUtf8SpanFormattable
interface IUtf8SpanParsable<sbyte>
interface IShiftOperators<sbyte, int, sbyte>
interface IMinMaxValue<sbyte>
interface ISignedNumber<sbyte>
[<System.CLSCompliant(false)>]
type sbyte = struct
interface IConvertible
interface IFormattable
interface IParsable<sbyte>
interface ISpanFormattable
interface ISpanParsable<sbyte>
interface IUtf8SpanFormattable
interface IUtf8SpanParsable<sbyte>
interface IAdditionOperators<sbyte, sbyte, sbyte>
interface IAdditiveIdentity<sbyte, sbyte>
interface IBinaryInteger<sbyte>
interface IBinaryNumber<sbyte>
interface IBitwiseOperators<sbyte, sbyte, sbyte>
interface IComparisonOperators<sbyte, sbyte, bool>
interface IEqualityOperators<sbyte, sbyte, bool>
interface IDecrementOperators<sbyte>
interface IDivisionOperators<sbyte, sbyte, sbyte>
interface IIncrementOperators<sbyte>
interface IModulusOperators<sbyte, sbyte, sbyte>
interface IMultiplicativeIdentity<sbyte, sbyte>
interface IMultiplyOperators<sbyte, sbyte, sbyte>
interface INumber<sbyte>
interface INumberBase<sbyte>
interface ISubtractionOperators<sbyte, sbyte, sbyte>
interface IUnaryNegationOperators<sbyte, sbyte>
interface IUnaryPlusOperators<sbyte, sbyte>
interface IShiftOperators<sbyte, int, sbyte>
interface IMinMaxValue<sbyte>
interface ISignedNumber<sbyte>
[<System.CLSCompliant(false)>]
[<System.Serializable>]
type sbyte = struct
interface IFormattable
interface IConvertible
[<System.CLSCompliant(false)>]
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type sbyte = struct
interface IFormattable
interface IConvertible
[<System.CLSCompliant(false)>]
type sbyte = struct
interface IFormattable
Public Structure SByte
Implements IComparable, IComparable(Of SByte), IConvertible, IEquatable(Of SByte), IFormattable
Public Structure SByte
Implements IComparable, IComparable(Of SByte), IConvertible, IEquatable(Of SByte), ISpanFormattable
Public Structure SByte
Implements IAdditionOperators(Of SByte, SByte, SByte), IAdditiveIdentity(Of SByte, SByte), IBinaryInteger(Of SByte), IBinaryNumber(Of SByte), IBitwiseOperators(Of SByte, SByte, SByte), IComparable(Of SByte), IComparisonOperators(Of SByte, SByte, Boolean), IConvertible, IDecrementOperators(Of SByte), IDivisionOperators(Of SByte, SByte, SByte), IEqualityOperators(Of SByte, SByte, Boolean), IEquatable(Of SByte), IIncrementOperators(Of SByte), IMinMaxValue(Of SByte), IModulusOperators(Of SByte, SByte, SByte), IMultiplicativeIdentity(Of SByte, SByte), IMultiplyOperators(Of SByte, SByte, SByte), INumber(Of SByte), INumberBase(Of SByte), IParsable(Of SByte), IShiftOperators(Of SByte, Integer, SByte), ISignedNumber(Of SByte), ISpanParsable(Of SByte), ISubtractionOperators(Of SByte, SByte, SByte), IUnaryNegationOperators(Of SByte, SByte), IUnaryPlusOperators(Of SByte, SByte)
Public Structure SByte
Implements IAdditionOperators(Of SByte, SByte, SByte), IAdditiveIdentity(Of SByte, SByte), IBinaryInteger(Of SByte), IBinaryNumber(Of SByte), IBitwiseOperators(Of SByte, SByte, SByte), IComparable(Of SByte), IComparisonOperators(Of SByte, SByte, Boolean), IConvertible, IDecrementOperators(Of SByte), IDivisionOperators(Of SByte, SByte, SByte), IEqualityOperators(Of SByte, SByte, Boolean), IEquatable(Of SByte), IIncrementOperators(Of SByte), IMinMaxValue(Of SByte), IModulusOperators(Of SByte, SByte, SByte), IMultiplicativeIdentity(Of SByte, SByte), IMultiplyOperators(Of SByte, SByte, SByte), INumber(Of SByte), INumberBase(Of SByte), IParsable(Of SByte), IShiftOperators(Of SByte, Integer, SByte), ISignedNumber(Of SByte), ISpanParsable(Of SByte), ISubtractionOperators(Of SByte, SByte, SByte), IUnaryNegationOperators(Of SByte, SByte), IUnaryPlusOperators(Of SByte, SByte), IUtf8SpanParsable(Of SByte)
Public Structure SByte
Implements IComparable, IConvertible, IFormattable
Public Structure SByte
Implements IComparable, IComparable(Of SByte), IEquatable(Of SByte), IFormattable
- Inheritance
- Attributes
- Implements
-
IComparable IComparable<SByte> IConvertible IEquatable<SByte> IFormattable ISpanFormattable IComparable<TSelf> IEquatable<TSelf> IParsable<SByte> IParsable<TSelf> ISpanParsable<SByte> ISpanParsable<TSelf> IAdditionOperators<SByte,SByte,SByte> IAdditionOperators<TSelf,TSelf,TSelf> IAdditiveIdentity<SByte,SByte> IAdditiveIdentity<TSelf,TSelf> IBinaryInteger<SByte> IBinaryNumber<SByte> IBinaryNumber<TSelf> IBitwiseOperators<SByte,SByte,SByte> IBitwiseOperators<TSelf,TSelf,TSelf> IComparisonOperators<SByte,SByte,Boolean> IComparisonOperators<TSelf,TSelf,Boolean> IDecrementOperators<SByte> IDecrementOperators<TSelf> IDivisionOperators<SByte,SByte,SByte> IDivisionOperators<TSelf,TSelf,TSelf> IEqualityOperators<SByte,SByte,Boolean> IEqualityOperators<TSelf,TOther,TResult> IEqualityOperators<TSelf,TSelf,Boolean> IIncrementOperators<SByte> IIncrementOperators<TSelf> IMinMaxValue<SByte> IModulusOperators<SByte,SByte,SByte> IModulusOperators<TSelf,TSelf,TSelf> IMultiplicativeIdentity<SByte,SByte> IMultiplicativeIdentity<TSelf,TSelf> IMultiplyOperators<SByte,SByte,SByte> IMultiplyOperators<TSelf,TSelf,TSelf> INumber<SByte> INumber<TSelf> INumberBase<SByte> INumberBase<TSelf> IShiftOperators<SByte,Int32,SByte> IShiftOperators<TSelf,Int32,TSelf> ISignedNumber<SByte> ISubtractionOperators<SByte,SByte,SByte> ISubtractionOperators<TSelf,TSelf,TSelf> IUnaryNegationOperators<SByte,SByte> IUnaryNegationOperators<TSelf,TSelf> IUnaryPlusOperators<SByte,SByte> IUnaryPlusOperators<TSelf,TSelf> IUtf8SpanFormattable IUtf8SpanParsable<SByte> IUtf8SpanParsable<TSelf>
Remarks
The SByte value type represents integers with values ranging from negative 128 to positive 127.
Important
The SByte type is not CLS-compliant. The CLS-compliant alternative type is Int16. Byte can be used instead to replace a positive SByte value that ranges from zero to MaxValue. For more information about CLS compliance, see Language Independence and Language-Independent Components.
SByte provides methods to compare instances of this type, convert the value of an instance to its string representation, and convert the string representation of a number to an instance of this type.
For information about how format specification codes control the string representation of value types, see Formatting Types.
Fields
MaxValue |
Represents the largest possible value of SByte. This field is constant. |
MinValue |
Represents the smallest possible value of SByte. This field is constant. |
Methods
Abs(SByte) |
Computes the absolute of a value. |
Clamp(SByte, SByte, SByte) |
Clamps a value to an inclusive minimum and maximum value. |
CompareTo(Object) |
Compares this instance to a specified object and returns an indication of their relative values. |
CompareTo(SByte) |
Compares this instance to a specified 8-bit signed integer and returns an indication of their relative values. |
CopySign(SByte, SByte) |
Copies the sign of a value to the sign of another value. |
CreateChecked<TOther>(TOther) |
Creates an instance of the current type from a value, throwing an overflow exception for any values that fall outside the representable range of the current type. |
CreateSaturating<TOther>(TOther) |
Creates an instance of the current type from a value, saturating any values that fall outside the representable range of the current type. |
CreateTruncating<TOther>(TOther) |
Creates an instance of the current type from a value, truncating any values that fall outside the representable range of the current type. |
DivRem(SByte, SByte) |
Computes the quotient and remainder of two values. |
Equals(Object) |
Returns a value indicating whether this instance is equal to a specified object. |
Equals(SByte) |
Returns a value indicating whether this instance is equal to a specified SByte value. |
GetHashCode() |
Returns the hash code for this instance. |
GetTypeCode() | |
IsEvenInteger(SByte) |
Determines if a value represents an even integral number. |
IsNegative(SByte) |
Determines if a value is negative. |
IsOddInteger(SByte) |
Determines if a value represents an odd integral number. |
IsPositive(SByte) |
Determines if a value is positive. |
IsPow2(SByte) |
Determines if a value is a power of two. |
LeadingZeroCount(SByte) |
Computes the number of leading zeros in a value. |
Log2(SByte) |
Computes the log2 of a value. |
Max(SByte, SByte) |
Compares two values to compute which is greater. |
MaxMagnitude(SByte, SByte) |
Compares two values to compute which is greater. |
Min(SByte, SByte) |
Compares two values to compute which is lesser. |
MinMagnitude(SByte, SByte) |
Compares two values to compute which is lesser. |
Parse(ReadOnlySpan<Byte>, IFormatProvider) |
Parses a span of UTF-8 characters into a value. |
Parse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider) |
Parses a span of UTF-8 characters into a value. |
Parse(ReadOnlySpan<Char>, IFormatProvider) |
Parses a span of characters into a value. |
Parse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider) |
Converts the span representation of a number that is in a specified style and culture-specific format to its 8-bit signed equivalent. |
Parse(String) |
Converts the string representation of a number to its 8-bit signed integer equivalent. |
Parse(String, IFormatProvider) |
Converts the string representation of a number in a specified culture-specific format to its 8-bit signed integer equivalent. |
Parse(String, NumberStyles) |
Converts the string representation of a number in a specified style to its 8-bit signed integer equivalent. |
Parse(String, NumberStyles, IFormatProvider) |
Converts the string representation of a number that is in a specified style and culture-specific format to its 8-bit signed equivalent. |
PopCount(SByte) |
Computes the number of bits that are set in a value. |
RotateLeft(SByte, Int32) |
Rotates a value left by a given amount. |
RotateRight(SByte, Int32) |
Rotates a value right by a given amount. |
Sign(SByte) |
Computes the sign of a value. |
ToString() |
Converts the numeric value of this instance to its equivalent string representation. |
ToString(IFormatProvider) |
Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information. |
ToString(String) |
Converts the numeric value of this instance to its equivalent string representation, using the specified format. |
ToString(String, IFormatProvider) |
Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information. |
TrailingZeroCount(SByte) |
Computes the number of trailing zeros in a value. |
TryFormat(Span<Byte>, Int32, ReadOnlySpan<Char>, IFormatProvider) |
Tries to format the value of the current instance as UTF-8 into the provided span of bytes. |
TryFormat(Span<Char>, Int32, ReadOnlySpan<Char>, IFormatProvider) |
Tries to format the value of the current 8-bit signed integer instance into the provided span of characters. |
TryParse(ReadOnlySpan<Byte>, IFormatProvider, SByte) |
Tries to parse a span of UTF-8 characters into a value. |
TryParse(ReadOnlySpan<Byte>, NumberStyles, IFormatProvider, SByte) |
Tries to parse a span of UTF-8 characters into a value. |
TryParse(ReadOnlySpan<Byte>, SByte) |
Tries to convert a UTF-8 character span containing the string representation of a number to its 8-bit signed integer equivalent. |
TryParse(ReadOnlySpan<Char>, IFormatProvider, SByte) |
Tries to parse a span of characters into a value. |
TryParse(ReadOnlySpan<Char>, NumberStyles, IFormatProvider, SByte) |
Tries to convert the span representation of a number in a specified style and culture-specific format to its SByte equivalent, and returns a value that indicates whether the conversion succeeded. |
TryParse(ReadOnlySpan<Char>, SByte) |
Tries to convert the span representation of a number to its SByte equivalent, and returns a value that indicates whether the conversion succeeded. |
TryParse(String, IFormatProvider, SByte) |
Tries to parse a string into a value. |
TryParse(String, NumberStyles, IFormatProvider, SByte) |
Tries to convert the string representation of a number in a specified style and culture-specific format to its SByte equivalent, and returns a value that indicates whether the conversion succeeded. |
TryParse(String, SByte) |
Tries to convert the string representation of a number to its SByte equivalent, and returns a value that indicates whether the conversion succeeded. |
Explicit Interface Implementations
Applies to
Thread Safety
All members of this type are thread safe. Members that appear to modify instance state actually return a new instance initialized with the new value. As with any other type, reading and writing to a shared variable that contains an instance of this type must be protected by a lock to guarantee thread safety.