JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
TestBinary16NOUI.java
Go to the documentation of this file.
1/**
2 * Copyright 2013 JogAmp Community. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without modification, are
5 * permitted provided that the following conditions are met:
6 *
7 * 1. Redistributions of source code must retain the above copyright notice, this list of
8 * conditions and the following disclaimer.
9 *
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * The views and conclusions contained in the software and documentation are those of the
25 * authors and should not be interpreted as representing official policies, either expressed
26 * or implied, of JogAmp Community.
27 */
28
29package com.jogamp.opengl.test.junit.math;
30
31import org.junit.Assert;
32import org.junit.FixMethodOrder;
33import org.junit.Test;
34import org.junit.runners.MethodSorters;
35
36import com.jogamp.math.Binary16;
37import com.jogamp.opengl.test.junit.util.MiscUtils;
38import com.jogamp.opengl.test.junit.util.UITestCase;
39
40@FixMethodOrder(MethodSorters.NAME_ASCENDING)
41public final class TestBinary16NOUI extends UITestCase /* due to hardship on machine, we want to run this test exclusively! */
42{
43 static int stepping = 1;
44 static boolean verbose = false;
45
46 /**
47 * Exponents in the range [-15, 16] are encoded and decoded correctly.
48 */
49
50 @SuppressWarnings("static-method") @Test public void testExponentIdentity()
51 {
52 System.out.println("-- Exponent identities");
53 for (int e = -15; e <= 16; ++e) {
55 final int u = Binary16.unpackGetExponentUnbiased(p);
56 if( verbose ) {
57 System.out.println("e: " + e +", p: "+Integer.toHexString(p)+", u: "+u);
58 }
59 Assert.assertEquals(e, u);
60 }
61 }
62
63 /**
64 * Infinities are infinite.
65 */
66
67 @SuppressWarnings("static-method") @Test public void testInfinite()
68 {
71 Assert.assertFalse(Binary16.isInfinite(Binary16.exampleNaN()));
72
73 for (int i = 0; i <= 65535; i+=stepping) {
74 Assert.assertFalse(Binary16.isInfinite(Binary16.packDouble(i)));
75 }
76 }
77
78 /**
79 * The unencoded exponent of infinity is 16.
80 */
81
82 @SuppressWarnings("static-method") @Test public void testInfinityExponent()
83 {
84 Assert.assertEquals(
85 16,
87 }
88
89 /**
90 * The unencoded exponent of infinity is 16.
91 */
92
93 @SuppressWarnings("static-method") @Test public
94 void
96 {
97 Assert.assertEquals(
98 16,
100 }
101
102 /**
103 * The sign of negative infinity is 1.
104 */
105
106 @SuppressWarnings("static-method") @Test public
107 void
109 {
110 Assert
112 }
113
114 /**
115 * The significand of infinity is 0.
116 */
117
118 @SuppressWarnings("static-method") @Test public
119 void
121 {
122 Assert.assertEquals(
123 0,
125 }
126
127 /**
128 * The sign of positive infinity is 0.
129 */
130
131 @SuppressWarnings("static-method") @Test public void testInfinitySign()
132 {
133 Assert
135 }
136
137 /**
138 * The significand of infinity is 0.
139 */
140
141 @SuppressWarnings("static-method") @Test public
142 void
144 {
145 Assert.assertEquals(
146 0,
148 }
149
150 /**
151 * NaN is NaN.
152 */
153
154 @SuppressWarnings("static-method") @Test public void testNaN()
155 {
156 final int n =
159 final char c = (char) n;
160 Assert.assertEquals(16, Binary16.unpackGetExponentUnbiased(c));
161 Assert.assertEquals(1, Binary16.unpackGetSignificand(c));
162 Assert.assertEquals(
163 16,
165 Assert.assertEquals(
166 1,
168 Assert.assertTrue(Binary16.isNaN(c));
169 Assert.assertTrue(Binary16.isNaN(Binary16.exampleNaN()));
170 }
171
172 /**
173 * Packing NaN results in NaN.
174 */
175
176 @SuppressWarnings("static-method") @Test public void testPackDoubleNaN()
177 {
178 final double k = Double.NaN;
179 final char r = Binary16.packDouble(k);
180 Assert.assertTrue(Binary16.isNaN(r));
181 }
182
183 /**
184 * Packing negative infinity results in negative infinity.
185 */
186
187 @SuppressWarnings("static-method") @Test public
188 void
190 {
191 Assert.assertTrue(Binary16.NEGATIVE_INFINITY == Binary16
192 .packDouble(Double.NEGATIVE_INFINITY));
193 }
194
195 /**
196 * Packing negative zero results in negative zero.
197 */
198
199 @SuppressWarnings("static-method") @Test public
200 void
202 {
203 Assert.assertTrue(Binary16.NEGATIVE_ZERO == Binary16.packDouble(-0.0));
204 }
205
206 /**
207 * Packing positive infinity results in positive infinity.
208 */
209
210 @SuppressWarnings("static-method") @Test public
211 void
213 {
214 Assert.assertTrue(Binary16.POSITIVE_INFINITY == Binary16
215 .packDouble(Double.POSITIVE_INFINITY));
216 }
217
218 /**
219 * Packing positive zero results in positive zero.
220 */
221
222 @SuppressWarnings("static-method") @Test public
223 void
225 {
226 Assert.assertTrue(Binary16.POSITIVE_ZERO == Binary16.packDouble(0.0));
227 }
228
229 /**
230 * Integers in the range [0, 65520] should be representable.
231 */
232
233 @SuppressWarnings({ "static-method", "boxing" }) @Test public
234 void
236 {
237 for (int i = 0; i <= 65536; i+=stepping) {
238 final double in = i;
239 final char packed = Binary16.packDouble(in);
240 final float r = Binary16.unpackFloat(packed);
241 if( verbose ) {
242 System.out.println(String.format(
243 "packed: 0x%04x 0b%s in: %f unpacked: %f",
244 (int) packed,
246 in,
247 r));
248 }
249
250 if (i <= 2048) {
251 Assert.assertEquals(in, r, 0.0);
252 }
253 if ((i > 2048) && (i <= 4096)) {
254 Assert.assertTrue((r % 2) == 0);
255 }
256 if ((i > 4096) && (i <= 8192)) {
257 Assert.assertTrue((r % 4) == 0);
258 }
259 if ((i > 8192) && (i <= 16384)) {
260 Assert.assertTrue((r % 8) == 0);
261 }
262 if ((i > 16384) && (i <= 32768)) {
263 Assert.assertTrue((r % 16) == 0);
264 }
265 if ((i > 32768) && (i < 65536)) {
266 Assert.assertTrue((r % 32) == 0);
267 }
268 if (i == 65536) {
269 Assert.assertTrue(Double.isInfinite(r));
270 }
271 }
272 }
273
274 /**
275 * Integers in the range [0, 65520] should be representable.
276 */
277
278 @SuppressWarnings({ "static-method", "boxing" }) @Test public
279 void
281 {
282 for (int i = 0; i <= 65536; i+=stepping) {
283 final float f_in = i;
284 final double d_in = i;
285 final char pf = Binary16.packFloat(f_in);
286 final char pd = Binary16.packDouble(d_in);
287
288 if( verbose ) {
289 System.out.println("i: " + i);
290 System.out.println(String.format(
291 "pack_f: 0x%04x 0b%s",
292 (int) pf,
294 System.out.println(String.format(
295 "pack_d: 0x%04x 0b%s",
296 (int) pd,
298 }
299
300 Assert.assertEquals(pf, pd);
301 }
302 }
303
304 /**
305 * Packing NaN results in NaN.
306 */
307
308 @SuppressWarnings("static-method") @Test public void testPackFloatNaN()
309 {
310 final float k = Float.NaN;
311 final char r = Binary16.packFloat(k);
312 Assert.assertTrue(Binary16.isNaN(r));
313 }
314
315 /**
316 * Packing negative infinity results in negative infinity.
317 */
318
319 @SuppressWarnings("static-method") @Test public
320 void
322 {
323 Assert.assertTrue(Binary16.NEGATIVE_INFINITY == Binary16
324 .packFloat(Float.NEGATIVE_INFINITY));
325 }
326
327 /**
328 * Packing negative zero results in negative zero.
329 */
330
331 @SuppressWarnings("static-method") @Test public
332 void
334 {
335 Assert.assertTrue(Binary16.NEGATIVE_ZERO == Binary16.packFloat(-0.0f));
336 }
337
338 /**
339 * Packing positive infinity results in positive infinity.
340 */
341
342 @SuppressWarnings("static-method") @Test public
343 void
345 {
346 Assert.assertTrue(Binary16.POSITIVE_INFINITY == Binary16
347 .packFloat(Float.POSITIVE_INFINITY));
348 }
349
350 /**
351 * Packing positive zero results in positive zero.
352 */
353
354 @SuppressWarnings("static-method") @Test public
355 void
357 {
358 Assert.assertTrue(Binary16.POSITIVE_ZERO == Binary16.packFloat(0.0f));
359 }
360
361 /**
362 * Integers in the range [0, 65520] should be representable.
363 */
364
365 @SuppressWarnings({ "static-method", "boxing" }) @Test public
366 void
368 {
369 for (int i = 0; i <= 65536; i+=stepping) {
370 final float in = i;
371 final char packed = Binary16.packFloat(in);
372 final double r = Binary16.unpackDouble(packed);
373 if( verbose ) {
374 System.out.println(String.format(
375 "packed: 0x%04x 0b%s in: %f unpacked: %f",
376 (int) packed,
378 in,
379 r));
380 }
381
382 if (i <= 2048) {
383 Assert.assertEquals(in, r, 0.0);
384 }
385 if ((i > 2048) && (i <= 4096)) {
386 Assert.assertTrue((r % 2) == 0);
387 }
388 if ((i > 4096) && (i <= 8192)) {
389 Assert.assertTrue((r % 4) == 0);
390 }
391 if ((i > 8192) && (i <= 16384)) {
392 Assert.assertTrue((r % 8) == 0);
393 }
394 if ((i > 16384) && (i <= 32768)) {
395 Assert.assertTrue((r % 16) == 0);
396 }
397 if ((i > 32768) && (i < 65536)) {
398 Assert.assertTrue((r % 32) == 0);
399 }
400 if (i == 65536) {
401 Assert.assertTrue(Double.isInfinite(r));
402 }
403 }
404 }
405
406 /**
407 * Integers in the range [0, 65520] should be representable.
408 */
409
410 @SuppressWarnings({ "static-method", "boxing" }) @Test public
411 void
413 {
414 for (int i = 0; i <= 65536; i+=stepping) {
415 final double in = i;
416 final char packed = Binary16.packDouble(in);
417 final double r = Binary16.unpackDouble(packed);
418 if( verbose ) {
419 System.out.println(String.format(
420 "packed: 0x%04x 0b%s in: %f unpacked: %f",
421 (int) packed,
423 in,
424 r));
425 }
426
427 if (i <= 2048) {
428 Assert.assertEquals(in, r, 0.0);
429 }
430 if ((i > 2048) && (i <= 4096)) {
431 Assert.assertTrue((r % 2) == 0);
432 }
433 if ((i > 4096) && (i <= 8192)) {
434 Assert.assertTrue((r % 4) == 0);
435 }
436 if ((i > 8192) && (i <= 16384)) {
437 Assert.assertTrue((r % 8) == 0);
438 }
439 if ((i > 16384) && (i <= 32768)) {
440 Assert.assertTrue((r % 16) == 0);
441 }
442 if ((i > 32768) && (i < 65536)) {
443 Assert.assertTrue((r % 32) == 0);
444 }
445 if (i == 65536) {
446 Assert.assertTrue(Double.isInfinite(r));
447 }
448 }
449 }
450
451 /**
452 * Integers in the range [0, 65520] should be representable.
453 */
454
455 @SuppressWarnings({ "static-method", "boxing" }) @Test public
456 void
458 {
459 for (int i = 0; i <= 65536; i+=stepping) {
460 final float in = i;
461 final char packed = Binary16.packFloat(in);
462 final float r = Binary16.unpackFloat(packed);
463 if( verbose ) {
464 System.out.println(String.format(
465 "packed: 0x%04x 0b%s in: %f unpacked: %f",
466 (int) packed,
468 in,
469 r));
470 }
471 if (i <= 2048) {
472 Assert.assertEquals(in, r, 0.0);
473 }
474 if ((i > 2048) && (i <= 4096)) {
475 Assert.assertTrue((r % 2) == 0);
476 }
477 if ((i > 4096) && (i <= 8192)) {
478 Assert.assertTrue((r % 4) == 0);
479 }
480 if ((i > 8192) && (i <= 16384)) {
481 Assert.assertTrue((r % 8) == 0);
482 }
483 if ((i > 16384) && (i <= 32768)) {
484 Assert.assertTrue((r % 16) == 0);
485 }
486 if ((i > 32768) && (i < 65536)) {
487 Assert.assertTrue((r % 32) == 0);
488 }
489 if (i == 65536) {
490 Assert.assertTrue(Float.isInfinite(r));
491 }
492 }
493 }
494
495 /**
496 * Signs in the range [0, 1] are encoded and decoded correctly.
497 */
498
499 @SuppressWarnings("static-method") @Test public void testSignIdentity()
500 {
501 System.out.println("-- Sign identities");
502 for (int e = 0; e <= 1; ++e) {
503 final char p = Binary16.packSetSignUnchecked(e);
504 final int u = Binary16.unpackGetSign(p);
505 if( verbose ) {
506 System.out.println("e: " + e +", p: "+Integer.toHexString(p)+", u: "+u);
507 }
508 Assert.assertEquals(e, u);
509 }
510 }
511
512 /**
513 * Significands in the range [0, 1023] are encoded and decoded correctly.
514 */
515
516 @SuppressWarnings("static-method") @Test public
517 void
519 {
520 System.out.println("-- Significand identities");
521 for (int e = 0; e <= 1023; ++e) {
522 final char p = Binary16.packSetSignificandUnchecked(e);
523 final int u = Binary16.unpackGetSignificand(p);
524 if( verbose ) {
525 System.out.println("e: " + e +", p: "+Integer.toHexString(p)+", u: "+u);
526 }
527 Assert.assertEquals(e, u);
528 }
529 }
530
531 /**
532 * Unpacking NaN results in NaN.
533 */
534
535 @SuppressWarnings("static-method") @Test public void testUnpackDoubleNaN()
536 {
537 final double k = Binary16.unpackDouble(Binary16.exampleNaN());
538 Assert.assertTrue(Double.isNaN(k));
539 }
540
541 /**
542 * Unpacking negative infinity results in negative infinity.
543 */
544
545 @SuppressWarnings("static-method") @Test public
546 void
548 {
549 Assert.assertTrue(Double.NEGATIVE_INFINITY == Binary16
551 }
552
553 /**
554 * Unpacking negative zero results in negative zero.
555 */
556
557 @SuppressWarnings("static-method") @Test public
558 void
560 {
561 Assert.assertTrue(-0.0 == Binary16.unpackDouble(Binary16.NEGATIVE_ZERO));
562 }
563
564 /**
565 * Unpacking 1.0 results in 1.0.
566 */
567
568 @SuppressWarnings({ "static-method", "boxing" }) @Test public
569 void
571 {
572 final char one = 0x3C00;
573 final double r = Binary16.unpackDouble(one);
574 System.out.println(String.format("0x%04x -> %f", (int) one, r));
575 Assert.assertEquals(r, 1.0, 0.0);
576 }
577
578 /**
579 * Unpacking -1.0 results in -1.0.
580 */
581
582 @SuppressWarnings({ "static-method", "boxing" }) @Test public
583 void
585 {
586 final char one = 0xBC00;
587 final double r = Binary16.unpackDouble(one);
588 System.out.println(String.format("0x%04x -> %f", (int) one, r));
589 Assert.assertEquals(r, -1.0, 0.0);
590 }
591
592 /**
593 * Unpacking positive infinity results in positive infinity.
594 */
595
596 @SuppressWarnings("static-method") @Test public
597 void
599 {
600 Assert.assertTrue(Double.POSITIVE_INFINITY == Binary16
602 }
603
604 /**
605 * Unpacking positive zero results in positive zero.
606 */
607
608 @SuppressWarnings("static-method") @Test public
609 void
611 {
612 Assert.assertTrue(0.0 == Binary16.unpackDouble(Binary16.POSITIVE_ZERO));
613 }
614
615 /**
616 * Unpacking 2.0 results in 2.0.
617 */
618
619 @SuppressWarnings({ "static-method", "boxing" }) @Test public
620 void
622 {
623 final char one = 0x4000;
624 final double r = Binary16.unpackDouble(one);
625 System.out.println(String.format("%04x -> %f", (int) one, r));
626 Assert.assertEquals(r, 2.0, 0.0);
627 }
628
629 /**
630 * Unpacking -2.0 results in -2.0.
631 */
632
633 @SuppressWarnings({ "static-method", "boxing" }) @Test public
634 void
636 {
637 final char one = 0xC000;
638 final double r = Binary16.unpackDouble(one);
639 System.out.println(String.format("%04x -> %f", (int) one, r));
640 Assert.assertEquals(r, -2.0, 0.0);
641 }
642
643 /**
644 * Unpacking NaN results in NaN.
645 */
646
647 @SuppressWarnings("static-method") @Test public void testUnpackFloatNaN()
648 {
649 final float k = Binary16.unpackFloat(Binary16.exampleNaN());
650 Assert.assertTrue(Float.isNaN(k));
651 }
652
653 /**
654 * Unpacking negative infinity results in negative infinity.
655 */
656
657 @SuppressWarnings("static-method") @Test public
658 void
660 {
661 Assert.assertTrue(Float.NEGATIVE_INFINITY == Binary16
663 }
664
665 /**
666 * Unpacking negative zero results in negative zero.
667 */
668
669 @SuppressWarnings("static-method") @Test public
670 void
672 {
673 Assert.assertTrue(-0.0 == Binary16.unpackFloat(Binary16.NEGATIVE_ZERO));
674 }
675
676 /**
677 * Unpacking 1.0 results in 1.0.
678 */
679
680 @SuppressWarnings({ "static-method", "boxing" }) @Test public
681 void
683 {
684 final char one = 0x3C00;
685 final float r = Binary16.unpackFloat(one);
686 System.out.println(String.format("0x%04x -> %f", (int) one, r));
687 Assert.assertEquals(r, 1.0, 0.0);
688 }
689
690 /**
691 * Unpacking -1.0 results in -1.0.
692 */
693
694 @SuppressWarnings({ "static-method", "boxing" }) @Test public
695 void
697 {
698 final char one = 0xBC00;
699 final float r = Binary16.unpackFloat(one);
700 System.out.println(String.format("0x%04x -> %f", (int) one, r));
701 Assert.assertEquals(r, -1.0, 0.0);
702 }
703
704 public static void main(final String args[]) {
705 for(int i=0; i<args.length; i++) {
706 if(args[i].equals("-stepping")) {
707 stepping = MiscUtils.atoi(args[++i], stepping);
708 } else if(args[i].equals("-verbose")) {
709 verbose = true;
710 }
711 }
712 org.junit.runner.JUnitCore.main(TestBinary16NOUI.class.getName());
713 }
714
715}
static char packSetExponentUnbiasedUnchecked(final int e)
Definition: Binary16.java:287
static char packSetSignificandUnchecked(final int s)
Definition: Binary16.java:305
static final char NEGATIVE_INFINITY
The encoded form of negative infinity -∞.
Definition: Binary16.java:44
static int unpackGetExponentUnbiased(final char k)
Definition: Binary16.java:529
static char exampleNaN()
One possible not-a-number value.
Definition: Binary16.java:93
static char packDouble(final double k)
Definition: Binary16.java:158
static boolean isNaN(final char k)
Return true if the given packed binary16 value is not a number (NaN).
Definition: Binary16.java:123
static final char POSITIVE_INFINITY
The encoded form of positive infinity ∞.
Definition: Binary16.java:50
static final char NEGATIVE_ZERO
The encoded form of negative zero -0.
Definition: Binary16.java:62
static int unpackGetSignificand(final char k)
Definition: Binary16.java:559
static char packSetSignUnchecked(final int s)
Definition: Binary16.java:322
static String toRawBinaryString(final char k)
Show the given raw packed binary16 value as a string of binary digits.
Definition: Binary16.java:335
static char packFloat(final float k)
Definition: Binary16.java:231
static double unpackDouble(final char k)
Definition: Binary16.java:376
static boolean isInfinite(final char k)
Return true if the given packed binary16 value is infinite.
Definition: Binary16.java:107
static final char POSITIVE_ZERO
The encoded form of positive zero 0.
Definition: Binary16.java:56
static int unpackGetSign(final char k)
Retrieve the sign bit of the given packed binary16 value, as an integer in the range [0,...
Definition: Binary16.java:544
static float unpackFloat(final char k)
Definition: Binary16.java:450
void testInfinityNegativeExponent()
The unencoded exponent of infinity is 16.
void testPackFloatNegativeZero()
Packing negative zero results in negative zero.
void testSignIdentity()
Signs in the range [0, 1] are encoded and decoded correctly.
void testPackFloatNaN()
Packing NaN results in NaN.
void testInfinityNegativeSignificand()
The significand of infinity is 0.
void testUnpackDoubleOneNegative()
Unpacking -1.0 results in -1.0.
void testUnpackFloatNegativeZero()
Unpacking negative zero results in negative zero.
void testPackDoubleNegativeInfinity()
Packing negative infinity results in negative infinity.
void testUnpackFloatNaN()
Unpacking NaN results in NaN.
void testPackFloatPositiveInfinity()
Packing positive infinity results in positive infinity.
void testUnpackDoubleNegativeZero()
Unpacking negative zero results in negative zero.
void testUnpackDoubleTwoNegative()
Unpacking -2.0 results in -2.0.
void testInfinitySign()
The sign of positive infinity is 0.
void testPackUnpackFloat()
Integers in the range [0, 65520] should be representable.
void testUnpackDoublePositiveZero()
Unpacking positive zero results in positive zero.
void testSignificandIdentity()
Significands in the range [0, 1023] are encoded and decoded correctly.
void testPackFloatUnpackDouble()
Integers in the range [0, 65520] should be representable.
void testPackDoublePositiveInfinity()
Packing positive infinity results in positive infinity.
void testUnpackDoublePositiveInfinity()
Unpacking positive infinity results in positive infinity.
void testUnpackDoubleTwo()
Unpacking 2.0 results in 2.0.
void testPackDoubleUnpackFloat()
Integers in the range [0, 65520] should be representable.
void testUnpackFloatOne()
Unpacking 1.0 results in 1.0.
void testPackFloatPositiveZero()
Packing positive zero results in positive zero.
void testExponentIdentity()
Exponents in the range [-15, 16] are encoded and decoded correctly.
void testUnpackDoubleOne()
Unpacking 1.0 results in 1.0.
void testInfinitySignificand()
The significand of infinity is 0.
void testUnpackDoubleNegativeInfinity()
Unpacking negative infinity results in negative infinity.
void testPackFloatNegativeInfinity()
Packing negative infinity results in negative infinity.
void testInfinityNegativeSign()
The sign of negative infinity is 1.
void testPackFloatDoubleEquivalent()
Integers in the range [0, 65520] should be representable.
void testUnpackFloatOneNegative()
Unpacking -1.0 results in -1.0.
void testInfinityExponent()
The unencoded exponent of infinity is 16.
void testPackDoubleNegativeZero()
Packing negative zero results in negative zero.
void testUnpackDoubleNaN()
Unpacking NaN results in NaN.
void testPackUnpackDouble()
Integers in the range [0, 65520] should be representable.
void testPackDoubleNaN()
Packing NaN results in NaN.
void testUnpackFloatNegativeInfinity()
Unpacking negative infinity results in negative infinity.
void testPackDoublePositiveZero()
Packing positive zero results in positive zero.
static int atoi(final String str, final int def)
Definition: MiscUtils.java:57