
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
BitConverter.Int64BitsToDouble() Method in C#
The BitConverter.Int64BitsToDouble() method in C# is used to reinterpret the specified 64-bit signed integer to a double-precision floating-point number.
Syntax
Following is the syntax −
public static double Int64BitsToDouble (long val);
Above, the parameter value is the number to convert.
Example
Let us now see an example to implement the BitConverter.Int64BitsToDouble() method −
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("
Value (double-precision floating point number) = "+res); } }
Output
This will produce the following output −
Value (64-bit signed integer) = 9846587687 Value (double-precision floating point number) = 4.86486070491012E-314
Example
Let us see another example −
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("
Value (double-precision floating point number) = "+res); } }
Output
This will produce the following output −
Value (64-bit signed integer) = 20 Value (double-precision floating point number) = 9.88131291682493E-323
Advertisements