PR rtl-optimization/57003
[official-gcc.git] / libjava / testsuite / libjava.lang / PR31264.java
blob5c0e85f010e189b640a834d629a2665c957799f9
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 */
10 public final class PR31264
12 public static long fubar(double d, int n)
14 long bits = Double.doubleToRawLongBits(d);
15 int exp = ((int)(bits >> 52)) & 0x7FF;
16 long m = bits & 0x000fffffffffffffL;
17 if (exp == 0)
19 if (m == 0) return 0L;
20 return fubar(d * 18014398509481984L, n - 54); // 2^54 Exact.
22 return m;
25 public static void main(String[] argv)