নির্দিষ্ট 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