author | Jaroslav Tulach <jaroslav.tulach@apidesign.org> |
Tue, 24 Feb 2015 11:12:53 +0100 | |
changeset 1787 | ea12a3bb4b33 |
parent 826 | fb751bcc23fd |
permissions | -rw-r--r-- |
jaroslav@826 | 1 |
/** |
jaroslav@826 | 2 |
* Back 2 Browser Bytecode Translator |
jaroslav@1787 | 3 |
* Copyright (C) 2012-2015 Jaroslav Tulach <jaroslav.tulach@apidesign.org> |
jaroslav@826 | 4 |
* |
jaroslav@826 | 5 |
* This program is free software: you can redistribute it and/or modify |
jaroslav@826 | 6 |
* it under the terms of the GNU General Public License as published by |
jaroslav@826 | 7 |
* the Free Software Foundation, version 2 of the License. |
jaroslav@826 | 8 |
* |
jaroslav@826 | 9 |
* This program is distributed in the hope that it will be useful, |
jaroslav@826 | 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
jaroslav@826 | 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
jaroslav@826 | 12 |
* GNU General Public License for more details. |
jaroslav@826 | 13 |
* |
jaroslav@826 | 14 |
* You should have received a copy of the GNU General Public License |
jaroslav@826 | 15 |
* along with this program. Look for COPYING file in the top folder. |
jaroslav@826 | 16 |
* If not, see http://opensource.org/licenses/GPL-2.0. |
jaroslav@826 | 17 |
*/ |
jaroslav@826 | 18 |
package org.apidesign.bck2brwsr.brwsrtest; |
jaroslav@826 | 19 |
|
jaroslav@826 | 20 |
import org.apidesign.bck2brwsr.vmtest.Compare; |
jaroslav@826 | 21 |
import org.apidesign.bck2brwsr.vmtest.VMTest; |
jaroslav@826 | 22 |
import org.testng.annotations.Factory; |
jaroslav@826 | 23 |
|
jaroslav@826 | 24 |
/** |
jaroslav@826 | 25 |
* |
jaroslav@826 | 26 |
* @author Jaroslav Tulach <jtulach@netbeans.org> |
jaroslav@826 | 27 |
*/ |
jaroslav@826 | 28 |
public class DoubleBitsTest { |
jaroslav@826 | 29 |
|
jaroslav@826 | 30 |
@Compare public String doubleToBits() { |
jaroslav@826 | 31 |
long val = Double.doubleToLongBits(333.456); |
jaroslav@826 | 32 |
return Long.toString(val); |
jaroslav@826 | 33 |
} |
jaroslav@826 | 34 |
|
jaroslav@826 | 35 |
@Compare public int floatToBits() { |
jaroslav@826 | 36 |
return Float.floatToIntBits(333.456f); |
jaroslav@826 | 37 |
} |
jaroslav@826 | 38 |
|
jaroslav@826 | 39 |
@Factory public static Object[] create() { |
jaroslav@826 | 40 |
return VMTest.create(DoubleBitsTest.class); |
jaroslav@826 | 41 |
} |
jaroslav@826 | 42 |
} |