View Javadoc

1   // Double.java, created Thu Jul  4  4:50:03 2002 by joewhaley
2   // Copyright (C) 2001-3 John Whaley <jwhaley@alum.mit.edu>
3   // Licensed under the terms of the GNU LGPL; see COPYING for details.
4   package joeq.ClassLib.Common.java.lang;
5   
6   import joeq.Runtime.Unsafe;
7   
8   /***
9    * Double
10   *
11   * @author  John Whaley <jwhaley@alum.mit.edu>
12   * @version $Id: Double.java 1456 2004-03-09 22:01:46Z jwhaley $
13   */
14  abstract class Double {
15  
16      // native method implementations.
17      public static long doubleToLongBits(double value) {
18          if (java.lang.Double.isNaN(value)) return 0x7ff8000000000000L;
19          return Unsafe.doubleToLongBits(value);
20      }
21      public static long doubleToRawLongBits(double value) {
22          return Unsafe.doubleToLongBits(value);
23      }
24      public static double longBitsToDouble(long bits) {
25          return Unsafe.longBitsToDouble(bits);
26      }
27      
28  }