Double To Int 64 Bits, Int 64 Bits To Double : Base64 « Development Class « C# / C Sharp

Home
C# / C Sharp
1.2D Graphics
2.Class Interface
3.Collections Data Structure
4.Components
5.Data Types
6.Database ADO.net
7.Date Time
8.Design Patterns
9.Development Class
10.Event
11.File Stream
12.Generics
13.GUI Windows Form
14.Internationalization I18N
15.Language Basics
16.LINQ
17.Network
18.Office
19.Reflection
20.Regular Expressions
21.Security
22.Services Event
23.Thread
24.Web Services
25.Windows
26.Windows Presentation Foundation
27.XML
28.XML LINQ
C# Book
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source
C# / C Sharp » Development Class » Base64Screenshots 
Double To Int 64 Bits, Int 64 Bits To Double
  
// Portions copyright 2005 - 2007: Diego Guidi
// Portions copyright 2006 - 2008: Rory Plaire ([email protected])
//
// This file is part of GeoAPI.
// GeoAPI is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
// 
// GeoAPI is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.

// You should have received a copy of the GNU Lesser General Public License
// along with GeoAPI; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 

#if NETCF
using System;

namespace GeoAPI.DataStructures
{
    /// <summary>
    /// A supoort class: the purpose is to integrate System.BitConverter 
    /// methods not presents in .NET Compact Framework.
    /// </summary>
    public class BitConverter
    {
        public static Int64 DoubleToInt64Bits(Double x)
        {
#if UNSAFE
            unsafe
            {
                return *(Int64*)&x;
            }
#else
            Byte[] bytes = System.BitConverter.GetBytes(x);
            Int64 value = System.BitConverter.ToInt64(bytes, 0);
            return value;
#endif
        }

        public static Double Int64BitsToDouble(Int64 x)
        {
#if UNSAFE
            unsafe
            {
                return *(Double*)&x;
            }
#else
            Byte[] bytes = System.BitConverter.GetBytes(x);
            Double value = System.BitConverter.ToDouble(bytes, 0);
            return value;
#endif
        }
    }
}
#endif

   
    
  
Related examples in the same category
1.Base 64 encode
2.Base64 Encoder
3.Url Encode Base 64
4.The Base64 utility class performs base64 encoding and decoding.
5.The Base64 utility class performs base64 encoding and decoding. The resulting binary data is returned as an array of bytes.
6.Decodes all or part of the input base64 encoded StringBuffer
7.Encode To 64
8.Encrypt Key and Decrypt Key with Convert.ToBase64String and Convert.FromBase64String
9.Base64 Serializer
10.Serializes and deserializes an entity to a base 64 string
11.Base64 from http://en.wikibooks.org/wiki/Algorithm_Implementation/Miscellaneous/Base64#Java
12.Convert To Base 64 String
13.Get Xml value as Integer 64
14.Create a hex string from an Int64 value
java2s.com  |  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.