C# में BitConverter.Int64BitsToDouble() विधि का उपयोग निर्दिष्ट 64-बिट हस्ताक्षरित पूर्णांक को डबल-सटीक फ़्लोटिंग-पॉइंट संख्या में पुन:व्याख्या करने के लिए किया जाता है।
सिंटैक्स
निम्नलिखित वाक्य रचना है -
public static double Int64BitsToDouble (long val);
ऊपर, पैरामीटर मान कनवर्ट करने की संख्या है।
उदाहरण
आइए अब BitConverter.Int64BitsToDouble() विधि को लागू करने के लिए एक उदाहरण देखें -
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