Certainly useful to the conversion, recorded down.
///Double =>ieee754 DoubleD =0.12345; byte[] IEEE754 =Bitconverter.getbytes (d); Console.WriteLine (Bitconverter.tostring (IEEE754)); //IEEE754 convert to double DoubleDr = Bitconverter.todouble (IEEE754,0); Console.WriteLine (Dr. ToString ()); //Double ==>long//another form of representation of IEEE 754 LongL =Bitconverter.doubletoint64bits (d); Console.WriteLine (Convert.ToString (L, -)); intInteger =Ten; byte[] Finteger =bitconverter.getbytes (integer); Console.WriteLine (Bitconverter.tostring (Finteger)); Const stringFormatter ="{0,25}{1,30}"; floatAsingl =0.1111111111111111111F; Longalong =1111111111111111111; intAnint =1111111111; ShortAshort =11111; CharAchar ='*'; BOOLAbool =true; DoubleAdoubl =0.1111111111111111111; 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))); Console.read ();
The result of the above operation
Useful Bitconverter