지정된 64비트 부호 있는 정수를 배정도 부동 소수점 숫자로 재해석하려면 코드는 다음과 같습니다. -
예시
using System;
public class Demo {
public static void Main() {
long d = 9846587687;
Console.Write("Value (64-bit signed integer) = "+d);
double res = BitConverter.Int64BitsToDouble(d);
Console.Write("\nValue (double-precision floating point number) = "+res);
}
} 출력
이것은 다음과 같은 출력을 생성합니다 -
Value (64-bit signed integer) = 9846587687 Value (double-precision floating point number) = 4.86486070491012E-314
예시
다른 예를 살펴보겠습니다 -
using System;
public class Demo {
public static void Main() {
long d = 20;
Console.Write("Value (64-bit signed integer) = "+d);
double res = BitConverter.Int64BitsToDouble(d);
Console.Write("\nValue (double-precision floating point number) = "+res);
}
} 출력
이것은 다음과 같은 출력을 생성합니다 -
Value (64-bit signed integer) = 20 Value (double-precision floating point number) = 9.88131291682493E-323