BitConverter Classe
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Converte tipi di dati di base in una matrice di byte e una matrice di byte in tipi di dati di base.
public ref class BitConverter abstract sealed
public ref class BitConverter sealed
public static class BitConverter
public sealed class BitConverter
type BitConverter = class
Public Class BitConverter
Public NotInheritable Class BitConverter
- Ereditarietà
-
BitConverter
Esempio
Nell'esempio di codice seguente viene illustrato l'uso di diversi BitConverter metodi di classe.
// Example of BitConverter class methods.
using namespace System;
int main()
{
String^ formatter = "{0,25}{1,30}";
double aDoubl = 0.1111111111111111111;
float aSingl = 0.1111111111111111111F;
__int64 aLong = 1111111111111111111;
int anInt = 1111111111;
short aShort = 11111;
__wchar_t aChar = L'*';
bool aBool = true;
Console::WriteLine( "This example of methods of the BitConverter class"
"\ngenerates the following output.\n" );
Console::WriteLine( formatter, "argument", "byte array" );
Console::WriteLine( formatter, "--------", "----------" );
// Convert values to Byte arrays and display them.
Console::WriteLine( formatter, aDoubl, BitConverter::ToString( BitConverter::GetBytes( aDoubl ) ) );
Console::WriteLine( formatter, aSingl, BitConverter::ToString( BitConverter::GetBytes( aSingl ) ) );
Console::WriteLine( formatter, aLong, BitConverter::ToString( BitConverter::GetBytes( aLong ) ) );
Console::WriteLine( formatter, anInt, BitConverter::ToString( BitConverter::GetBytes( anInt ) ) );
Console::WriteLine( formatter, aShort, BitConverter::ToString( BitConverter::GetBytes( aShort ) ) );
Console::WriteLine( formatter, aChar, BitConverter::ToString( BitConverter::GetBytes( aChar ) ) );
Console::WriteLine( formatter, aBool, BitConverter::ToString( BitConverter::GetBytes( aBool ) ) );
}
/*
This example of methods of the BitConverter class
generates the following output.
argument byte array
-------- ----------
0.111111111111111 1C-C7-71-1C-C7-71-BC-3F
0.1111111 39-8E-E3-3D
1111111111111111111 C7-71-C4-2B-AB-75-6B-0F
1111111111 C7-35-3A-42
11111 67-2B
* 2A-00
True 01
*/
// Example of BitConverter class methods.
using System;
class BitConverterDemo
{
public static void Main( )
{
const string formatter = "{0,25}{1,30}";
double aDoubl = 0.1111111111111111111;
float aSingl = 0.1111111111111111111F;
long aLong = 1111111111111111111;
int anInt = 1111111111;
short aShort = 11111;
char aChar = '*';
bool aBool = true;
Console.WriteLine(
"This example of methods of the BitConverter class" +
"\ngenerates the following output.\n" );
Console.WriteLine( formatter, "argument", "byte array" );
Console.WriteLine( formatter, "--------", "----------" );
// Convert values to Byte arrays and display them.
Console.WriteLine( formatter, aDoubl,
BitConverter.ToString( BitConverter.GetBytes( aDoubl ) ) );
Console.WriteLine( formatter, aSingl,
BitConverter.ToString( BitConverter.GetBytes( aSingl ) ) );
Console.WriteLine( formatter, aLong,
BitConverter.ToString( BitConverter.GetBytes( aLong ) ) );
Console.WriteLine( formatter, anInt,
BitConverter.ToString( BitConverter.GetBytes( anInt ) ) );
Console.WriteLine( formatter, aShort,
BitConverter.ToString( BitConverter.GetBytes( aShort ) ) );
Console.WriteLine( formatter, aChar,
BitConverter.ToString( BitConverter.GetBytes( aChar ) ) );
Console.WriteLine( formatter, aBool,
BitConverter.ToString( BitConverter.GetBytes( aBool ) ) );
}
}
/*
This example of methods of the BitConverter class
generates the following output.
argument byte array
-------- ----------
0.111111111111111 1C-C7-71-1C-C7-71-BC-3F
0.1111111 39-8E-E3-3D
1111111111111111111 C7-71-C4-2B-AB-75-6B-0F
1111111111 C7-35-3A-42
11111 67-2B
* 2A-00
True 01
*/
open System
let print: obj -> obj -> unit = printfn "%25O%30O"
let aDoubl = 0.1111111111111111111
let aSingl = 0.1111111111111111111f
let aLong = 1111111111111111111L
let anInt = 1111111111
let aShort = 11111s
let aChar = '*'
let aBool = true
printfn "This example of methods of the BitConverter class\ngenerates the following output.\n"
print "argument" "byte array"
print "--------" "----------"
// Convert values to Byte arrays and display them.
print aDoubl (BitConverter.ToString(BitConverter.GetBytes aDoubl))
print aSingl (BitConverter.ToString(BitConverter.GetBytes aSingl))
print aLong (BitConverter.ToString(BitConverter.GetBytes aLong))
print anInt (BitConverter.ToString(BitConverter.GetBytes anInt))
print aShort (BitConverter.ToString(BitConverter.GetBytes aShort))
print aChar (BitConverter.ToString(BitConverter.GetBytes aChar))
print aBool (BitConverter.ToString(BitConverter.GetBytes aBool))
// This example of methods of the BitConverter class
// generates the following output.
//
// argument byte array
// -------- ----------
// 0.111111111111111 1C-C7-71-1C-C7-71-BC-3F
// 0.1111111 39-8E-E3-3D
// 1111111111111111111 C7-71-C4-2B-AB-75-6B-0F
// 1111111111 C7-35-3A-42
// 11111 67-2B
// * 2A-00
// True 01
' Example of BitConverter class methods.
Module BitConverterDemo
Sub Main( )
Const formatter As String = "{0,25}{1,30}"
Dim aDoubl As Double = 0.1111111111111111111
Dim aSingl As Single = 0.1111111111111111111
Dim aLong As Long = 1111111111111111111
Dim anInt As Integer = 1111111111
Dim aShort As Short = 11111
Dim aChar As Char = "*"c
Dim aBool As Boolean = True
Console.WriteLine( _
"This example of methods of the BitConverter class" & _
vbCrLf & "generates the following output." & vbCrLf )
Console.WriteLine( formatter, "argument", "Byte array" )
Console.WriteLine( formatter, "--------", "----------" )
' Convert values to Byte arrays and display them.
Console.WriteLine( formatter, aDoubl, _
BitConverter.ToString( BitConverter.GetBytes( aDoubl ) ) )
Console.WriteLine( formatter, aSingl, _
BitConverter.ToString( BitConverter.GetBytes( aSingl ) ) )
Console.WriteLine( formatter, aLong, _
BitConverter.ToString( BitConverter.GetBytes( aLong ) ) )
Console.WriteLine( formatter, anInt, _
BitConverter.ToString( BitConverter.GetBytes( anInt ) ) )
Console.WriteLine( formatter, aShort, _
BitConverter.ToString( BitConverter.GetBytes( aShort ) ) )
Console.WriteLine( formatter, aChar, _
BitConverter.ToString( BitConverter.GetBytes( aChar ) ) )
Console.WriteLine( formatter, aBool, _
BitConverter.ToString( BitConverter.GetBytes( aBool ) ) )
End Sub
End Module
' This example of methods of the BitConverter class
' generates the following output.
'
' argument Byte array
' -------- ----------
' 0.111111111111111 1C-C7-71-1C-C7-71-BC-3F
' 0.1111111 39-8E-E3-3D
' 1111111111111111111 C7-71-C4-2B-AB-75-6B-0F
' 1111111111 C7-35-3A-42
' 11111 67-2B
' * 2A-00
' True 01
Commenti
La BitConverter classe consente di modificare i tipi di valore nella forma fondamentale, come serie di byte. Un byte viene definito come intero senza segno a 8 bit. La BitConverter classe include metodi statici per convertire ognuno dei tipi primitivi in e da una matrice di byte, come illustrato nella tabella seguente.
Type | Conversione di byte | Conversione di byte |
---|---|---|
Boolean | GetBytes(Boolean) | ToBoolean |
Char | GetBytes(Char) | ToChar |
Double | GetBytes(Double) -oppure- DoubleToInt64Bits(Double) |
ToDouble -oppure- Int64BitsToDouble |
Int16 | GetBytes(Int16) | ToInt16 |
Int32 | GetBytes(Int32) | ToInt32 |
Int64 | GetBytes(Int64) | ToInt64 |
Single | GetBytes(Single) | ToSingle |
UInt16 | GetBytes(UInt16) | ToUInt16 |
UInt32 | GetBytes(UInt32) | ToUInt32 |
UInt64 | GetBytes(UInt64) | ToUInt64 |
Se si usano BitConverter metodi per eseguire il round trip dei dati, assicurarsi che l'overload GetBytes e il To
metodo Type specificano lo stesso tipo. Come illustrato nell'esempio seguente, il ripristino di una matrice che rappresenta un intero firmato chiamando il ToUInt32 metodo può comportare un valore diverso dall'originale. Per altre informazioni, vedere Uso dei valori non decimali e bit per bit firmati.
using System;
public class Example
{
public static void Main()
{
int value = -16;
Byte[] bytes = BitConverter.GetBytes(value);
// Convert bytes back to int.
int intValue = BitConverter.ToInt32(bytes, 0);
Console.WriteLine("{0} = {1}: {2}",
value, intValue,
value.Equals(intValue) ? "Round-trips" : "Does not round-trip");
// Convert bytes to UInt32.
uint uintValue = BitConverter.ToUInt32(bytes, 0);
Console.WriteLine("{0} = {1}: {2}", value, uintValue,
value.Equals(uintValue) ? "Round-trips" : "Does not round-trip");
}
}
// The example displays the following output:
// -16 = -16: Round-trips
// -16 = 4294967280: Does not round-trip
open System
let value = -16
let bytes = BitConverter.GetBytes value
// Convert bytes back to int.
let intValue = BitConverter.ToInt32(bytes, 0)
printfn $"""{value} = {intValue}: {if value.Equals intValue then "Round-trips" else "Does not round-trip"}"""
// Convert bytes to UInt32.
let uintValue = BitConverter.ToUInt32(bytes, 0)
printfn $"""{value} = {uintValue}: {if value.Equals uintValue then "Round-trips" else "Does not round-trip"}"""
// The example displays the following output:
// -16 = -16: Round-trips
// -16 = 4294967280: Does not round-trip
Module Example
Public Sub Main()
Dim value As Integer = -16
Dim bytes() As Byte = BitConverter.GetBytes(value)
' Convert bytes back to Int32.
Dim intValue As Integer = BitConverter.ToInt32(bytes, 0)
Console.WriteLine("{0} = {1}: {2}",
value, intValue,
If(value.Equals(intValue), "Round-trips", "Does not round-trip"))
' Convert bytes to UInt32.
Dim uintValue As UInteger = BitConverter.ToUInt32(bytes, 0)
Console.WriteLine("{0} = {1}: {2}", value, uintValue,
If(value.Equals(uintValue), "Round-trips", "Does not round-trip"))
End Sub
End Module
' The example displays the following output:
' -16 = -16: Round-trips
' -16 = 4294967280: Does not round-trip
L'ordine di byte nella matrice restituito dagli GetBytes overload del metodo (nonché l'ordine di bit nell'intero restituito dal DoubleToInt64Bits metodo) dipende dal fatto che l'architettura del computer sia little-endian o big-endian. Analogamente, l'ordine di byte nella matrice e restituito dai To
metodi IntegerValue e il ToChar metodo dipende dal fatto che l'architettura del computer sia little-endian o big-endian. La endianità di un'architettura è indicata dalla IsLittleEndian proprietà, che restituisce true
nei sistemi little-endian e false
nei sistemi big-endian. Nei sistemi little-endian, i byte di ordine inferiore precedono byte di ordine superiore. Nel sistema big-endian, i byte di ordine superiore precedono byte di ordine inferiore. La tabella seguente illustra la differenza nelle matrici di byte che derivano dal passaggio del valore intero 1.234.567.890 (0x499602D2) al GetBytes(Int32) metodo . I byte sono elencati in ordine dal byte all'indice 0 al byte all'indice 3.
Little-endian | D2-02-96-49 |
Big-endian | 49-96-02-D2 |
Poiché il valore restituito di alcuni metodi dipende dall'architettura di sistema, prestare attenzione durante la trasmissione dei dati di byte oltre i limiti del computer:
Se tutti i sistemi che inviano e ricevono i dati devono avere la stessa endianità, non è necessario eseguire alcuna operazione ai dati.
Se i sistemi che inviano e ricevono dati possono avere un'endianità diversa, trasmettere sempre i dati in un ordine specifico. Ciò significa che l'ordine di byte nella matrice potrebbe essere invertito prima di inviarli o dopo averli ricevuti. Una convenzione comune consiste nel trasmettere i dati nell'ordine di byte di rete (ordine big-endian). Nell'esempio seguente viene fornita un'implementazione per l'invio di un valore integer nell'ordine di byte di rete.
using System; public class Example { public static void Main() { int value = 12345678; byte[] bytes = BitConverter.GetBytes(value); Console.WriteLine(BitConverter.ToString(bytes)); if (BitConverter.IsLittleEndian) Array.Reverse(bytes); Console.WriteLine(BitConverter.ToString(bytes)); // Call method to send byte stream across machine boundaries. // Receive byte stream from beyond machine boundaries. Console.WriteLine(BitConverter.ToString(bytes)); if (BitConverter.IsLittleEndian) Array.Reverse(bytes); Console.WriteLine(BitConverter.ToString(bytes)); int result = BitConverter.ToInt32(bytes, 0); Console.WriteLine("Original value: {0}", value); Console.WriteLine("Returned value: {0}", result); } } // The example displays the following output on a little-endian system: // 4E-61-BC-00 // 00-BC-61-4E // 00-BC-61-4E // 4E-61-BC-00 // Original value: 12345678 // Returned value: 12345678
open System let value = 12345678 let bytes = BitConverter.GetBytes value printfn $"{BitConverter.ToString bytes}" if BitConverter.IsLittleEndian then Array.Reverse bytes printfn $"{BitConverter.ToString bytes}" // Call method to send byte stream across machine boundaries. // Receive byte stream from beyond machine boundaries. printfn $"{BitConverter.ToString bytes}" if BitConverter.IsLittleEndian then Array.Reverse bytes printfn $"{BitConverter.ToString bytes}" let result = BitConverter.ToInt32(bytes, 0) printfn $"Original value: {value}" printfn $"Returned value: {result}" // The example displays the following output on a little-endian system: // 4E-61-BC-00 // 00-BC-61-4E // 00-BC-61-4E // 4E-61-BC-00 // Original value: 12345678 // Returned value: 12345678
Module Example Public Sub Main() Dim value As Integer = 12345678 Dim bytes() As Byte = BitConverter.GetBytes(value) Console.WriteLine(BitConverter.ToString(bytes)) If BitConverter.IsLittleEndian Then Array.Reverse(bytes) End If Console.WriteLine(BitConverter.ToString(bytes)) ' Call method to send byte stream across machine boundaries. ' Receive byte stream from beyond machine boundaries. Console.WriteLine(BitConverter.ToString(bytes)) If BitConverter.IsLittleEndian Then Array.Reverse(bytes) End If Console.WriteLine(BitConverter.ToString(bytes)) Dim result As Integer = BitConverter.ToInt32(bytes, 0) Console.WriteLine("Original value: {0}", value) Console.WriteLine("Returned value: {0}", result) End Sub End Module ' The example displays the following output on a little-endian system: ' 4E-61-BC-00 ' 00-BC-61-4E ' 00-BC-61-4E ' 4E-61-BC-00 ' Original value: 12345678 ' Returned value: 12345678
Se i sistemi che inviano e ricevono dati possono avere un'endianità diversa e i dati da trasmettere sono numeri interi firmati, chiamare il IPAddress.HostToNetworkOrder metodo per convertire i dati in ordine di byte di rete e il IPAddress.NetworkToHostOrder metodo per convertirlo nell'ordine richiesto dal destinatario.
Campi
IsLittleEndian |
Indica l'ordine dei byte ("architettura endian") in cui vengono memorizzati i dati in questa architettura di computer. |
Metodi
DoubleToInt64Bits(Double) |
Converte il numero in virgola mobile e precisione doppia specificato in un intero con segno a 64 bit. |
DoubleToUInt64Bits(Double) |
Converte il numero a virgola mobile a precisione doppia specificata in un intero senza segno a 64 bit. |
GetBytes(Boolean) |
Restituisce il valore booleano specificato come matrice di byte. |
GetBytes(Char) |
Restituisce il valore del carattere Unicode specificato come matrice di byte. |
GetBytes(Double) |
Restituisce il valore a virgola mobile a precisione doppia specificato come matrice di byte. |
GetBytes(Half) |
Restituisce il valore a virgola mobile a metà precisione specificato come matrice di byte. |
GetBytes(Int128) |
Converte tipi di dati di base in una matrice di byte e una matrice di byte in tipi di dati di base. |
GetBytes(Int16) |
Restituisce il valore dell'integer con segno a 16 bit specificato come matrice di byte. |
GetBytes(Int32) |
Restituisce il valore intero con segno a 32 bit specificato come matrice di byte. |
GetBytes(Int64) |
Restituisce il valore intero con segno a 64 bit specificato come matrice di byte. |
GetBytes(Single) |
Restituisce il valore in virgola mobile e precisione singola specificato come matrice di byte. |
GetBytes(UInt128) |
Converte tipi di dati di base in una matrice di byte e una matrice di byte in tipi di dati di base. |
GetBytes(UInt16) |
Restituisce il valore dell'integer senza segno a 16 bit specificato come matrice di byte. |
GetBytes(UInt32) |
Restituisce il valore dell'intero senza segno a 32 bit specificato come matrice di byte. |
GetBytes(UInt64) |
Restituisce il valore dell'intero senza segno a 64 bit specificato come matrice di byte. |
HalfToInt16Bits(Half) |
Converte un valore a virgola mobile a metà precisione in un intero a 16 bit. |
HalfToUInt16Bits(Half) |
Converte il numero a virgola mobile a metà precisione specificato in un intero senza segno a 16 bit. |
Int16BitsToHalf(Int16) |
Reinterpreta il valore intero con segno a 16 bit specificato come valore a virgola mobile a metà precisione. |
Int32BitsToSingle(Int32) |
Reinterpreta il valore intero a 32 bit specificato come valore a virgola mobile e precisione singola. |
Int64BitsToDouble(Int64) |
Reinterpreta il valore intero con segno a 64 bit specificato in un numero in virgola mobile e precisione doppia. |
SingleToInt32Bits(Single) |
Converte un valore a virgola mobile e precisione singola in un intero. |
SingleToUInt32Bits(Single) |
Converte il numero a virgola mobile a precisione singola specificato in un intero senza segno a 32 bit. |
ToBoolean(Byte[], Int32) |
Restituisce un valore booleano convertito da un byte in una posizione specificata in una matrice di byte. |
ToBoolean(ReadOnlySpan<Byte>) |
Converte un intervallo di byte di sola lettura in un valore booleano. |
ToChar(Byte[], Int32) |
Restituisce un carattere Unicode convertito da due byte nella posizione specificata in una matrice di byte. |
ToChar(ReadOnlySpan<Byte>) |
Converte un intervallo di byte di sola lettura in un carattere. |
ToDouble(Byte[], Int32) |
Restituisce un numero in virgola mobile e precisione doppia convertito da otto byte nella posizione specificata in una matrice di byte. |
ToDouble(ReadOnlySpan<Byte>) |
Converte un intervallo di byte di sola lettura in un valore a virgola mobile e precisione doppia. |
ToHalf(Byte[], Int32) |
Restituisce un numero a virgola mobile a metà precisione convertito da due byte in una posizione specificata in una matrice di byte. |
ToHalf(ReadOnlySpan<Byte>) |
Converte un intervallo di byte di sola lettura in un valore a virgola mobile a metà precisione. |
ToInt128(Byte[], Int32) |
Converte tipi di dati di base in una matrice di byte e una matrice di byte in tipi di dati di base. |
ToInt128(ReadOnlySpan<Byte>) |
Converte tipi di dati di base in una matrice di byte e una matrice di byte in tipi di dati di base. |
ToInt16(Byte[], Int32) |
Restituisce un intero con segno a 16 bit convertito da due byte nella posizione specificata in una matrice di byte. |
ToInt16(ReadOnlySpan<Byte>) |
Converte un intervallo di byte di sola lettura in un intero con segno a 16 bit. |
ToInt32(Byte[], Int32) |
Restituisce un intero con segno a 32 bit convertito da quattro byte nella posizione specificata in una matrice di byte. |
ToInt32(ReadOnlySpan<Byte>) |
Converte un intervallo di byte di sola lettura in un intero con segno a 32 bit. |
ToInt64(Byte[], Int32) |
Restituisce un intero con segno a 64 bit convertito da otto byte nella posizione specificata in una matrice di byte. |
ToInt64(ReadOnlySpan<Byte>) |
Converte un intervallo di byte di sola lettura in un intero con segno a 64 bit. |
ToSingle(Byte[], Int32) |
Restituisce un numero in virgola mobile e precisione singola convertito da quattro byte nella posizione specificata in una matrice di byte. |
ToSingle(ReadOnlySpan<Byte>) |
Converte un intervallo di byte di sola lettura in un valore a virgola mobile a precisione singola. |
ToString(Byte[]) |
Converte il valore numerico di ogni elemento di una matrice specificata di byte nella relativa rappresentazione di stringa esadecimale equivalente. |
ToString(Byte[], Int32) |
Converte il valore numerico di ogni elemento di una sottomatrice specificata di byte nella relativa rappresentazione di stringa esadecimale equivalente. |
ToString(Byte[], Int32, Int32) |
Converte il valore numerico di ogni elemento di una sottomatrice specificata di byte nella relativa rappresentazione di stringa esadecimale equivalente. |
ToUInt128(Byte[], Int32) |
Converte tipi di dati di base in una matrice di byte e una matrice di byte in tipi di dati di base. |
ToUInt128(ReadOnlySpan<Byte>) |
Converte tipi di dati di base in una matrice di byte e una matrice di byte in tipi di dati di base. |
ToUInt16(Byte[], Int32) |
Restituisce un intero senza segno a 16 bit convertito da due byte nella posizione specificata in una matrice di byte. |
ToUInt16(ReadOnlySpan<Byte>) |
Converte un intervallo di byte di sola lettura in un intero senza segno a 16 bit. |
ToUInt32(Byte[], Int32) |
Restituisce un intero senza segno a 32 bit convertito da quattro byte nella posizione specificata in una matrice di byte. |
ToUInt32(ReadOnlySpan<Byte>) |
Converte un intervallo di byte di sola lettura in un intero senza segno a 32 bit. |
ToUInt64(Byte[], Int32) |
Restituisce un intero senza segno a 64 bit convertito da otto byte nella posizione specificata in una matrice di byte. |
ToUInt64(ReadOnlySpan<Byte>) |
Converte i byte in un valore long senza segno. |
TryWriteBytes(Span<Byte>, Boolean) |
Converte un valore booleano in un intervallo di byte. |
TryWriteBytes(Span<Byte>, Char) |
Converte un carattere in un intervallo di byte. |
TryWriteBytes(Span<Byte>, Double) |
Converte un valore a virgola mobile e precisione doppia in un intervallo di byte. |
TryWriteBytes(Span<Byte>, Half) |
Converte un valore a virgola mobile a metà precisione in un intervallo di byte. |
TryWriteBytes(Span<Byte>, Int128) |
Converte tipi di dati di base in una matrice di byte e una matrice di byte in tipi di dati di base. |
TryWriteBytes(Span<Byte>, Int16) |
Converte un intero con segno a 16 bit in un intervallo di byte. |
TryWriteBytes(Span<Byte>, Int32) |
Converte un intero con segno a 32 bit in un intervallo di byte. |
TryWriteBytes(Span<Byte>, Int64) |
Converte un intero con segno a 64 bit in un intervallo di byte. |
TryWriteBytes(Span<Byte>, Single) |
Converte un valore a virgola mobile a precisione singola in un intervallo di byte. |
TryWriteBytes(Span<Byte>, UInt128) |
Converte tipi di dati di base in una matrice di byte e una matrice di byte in tipi di dati di base. |
TryWriteBytes(Span<Byte>, UInt16) |
Converte un intero senza segno a 16 bit in un intervallo di byte. |
TryWriteBytes(Span<Byte>, UInt32) |
Converte un intero senza segno a 32 bit in un intervallo di byte. |
TryWriteBytes(Span<Byte>, UInt64) |
Converte un intero a 64 bit senza segno in un intervallo di byte. |
UInt16BitsToHalf(UInt16) |
Converte l'intero senza segno a 16 bit specificato in un numero a virgola mobile a metà precisione. |
UInt32BitsToSingle(UInt32) |
Converte l'intero senza segno a 32 bit specificato in un numero a virgola mobile a precisione singola. |
UInt64BitsToDouble(UInt64) |
Converte l'intero senza segno a 64 bit specificato in un numero a virgola mobile con precisione doppia. |
Si applica a
Vedi anche
Commenti e suggerimenti
https://aka.ms/ContentUserFeedback.
Presto disponibile: Nel corso del 2024 verranno gradualmente disattivati i problemi di GitHub come meccanismo di feedback per il contenuto e ciò verrà sostituito con un nuovo sistema di feedback. Per altre informazioni, vedereInvia e visualizza il feedback per