1 /* 2 * Javolution - Java(TM) Solution for Real-Time and Embedded Systems 3 * Copyright (C) 2006 - Javolution (http://javolution.org/) 4 * All rights reserved. 5 * 6 * Permission to use, copy, modify, and distribute this software is 7 * freely granted, provided that this notice is preserved. 8 */ 9 10 public final class PR31264 11 { fubar(double d, int n)12 public static long fubar(double d, int n) 13 { 14 long bits = Double.doubleToRawLongBits(d); 15 int exp = ((int)(bits >> 52)) & 0x7FF; 16 long m = bits & 0x000fffffffffffffL; 17 if (exp == 0) 18 { 19 if (m == 0) return 0L; 20 return fubar(d * 18014398509481984L, n - 54); // 2^54 Exact. 21 } 22 return m; 23 } 24 main(String[] argv)25 public static void main(String[] argv) 26 { 27 } 28 } 29