1 // -*- Mode: Java; indent-tabs-mode: t; tab-width: 4 -*-
2 // ---------------------------------------------------------------------------
4 // Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
5 // ---------------------------------------------------------------------------
6 // SquirrelJME is under the GNU General Public License v3+, or later.
7 // See license.mkd for licensing and copyright information.
8 // ---------------------------------------------------------------------------
10 package cc
.squirreljme
.jvm
.mle
;
12 import cc
.squirreljme
.runtime
.cldc
.annotation
.SquirrelJMEVendorApi
;
15 * This contains various math functions.
20 public final class MathShelf
32 * Packs the given two integers to a double value.
34 * @param __lo The low value.
35 * @param __hi The high value.
36 * @return The double value.
39 public static native double doublePack(int __lo
, int __hi
);
42 * Unpacks the high value of a double.
44 * @param __d The double to unpack.
45 * @return The unpacked high value.
48 public static native int doubleUnpackHigh(double __d
);
51 * Unpacks the low value of a double.
53 * @param __d The double to unpack.
54 * @return The unpacked low value.
57 public static native int doubleUnpackLow(double __d
);
60 * Packs the given two integers to a long value.
62 * @param __lo The low value.
63 * @param __hi The high value.
64 * @return The long value.
67 public static native long longPack(int __lo
, int __hi
);
70 * Unpack high value from long.
72 * @param __v The long value.
73 * @return The unpacked fragment.
76 public static native int longUnpackHigh(long __v
);
79 * Unpack low value from long.
81 * @param __v The long value.
82 * @return The unpacked fragment.
85 public static native int longUnpackLow(long __v
);
88 * Extracts the raw bits of the given value.
90 * @param __v The value to extract.
91 * @return The raw bits.
94 public static native long rawDoubleToLong(double __v
);
97 * Extracts the raw bits of the given value.
99 * @param __v The value to extract.
100 * @return The raw bits.
103 public static native int rawFloatToInt(float __v
);
106 * Composes the value from the given bits
108 * @param __b The raw bits.
112 public static native float rawIntToFloat(int __b
);
115 * Composes the value from the given bits
117 * @param __b The raw bits.
121 public static native double rawLongToDouble(long __b
);