Skip to content

Instantly share code, notes, and snippets.

@tbuktu
tbuktu / BigIntegerTest.java
Created January 10, 2012 04:38
Updated BigInteger unit test for https://gist.github.com/1576025
/*
* Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
--- jdk8/test/java/math/BigInteger/BigIntegerTest.java 2012-01-09 20:27:23.000000000 -0700
+++ src/test/java/BigIntegerTest.java 2012-01-09 21:25:25.000000000 -0700
@@ -52,17 +52,12 @@
static int size = 1000; // numbers per batch
static boolean failure = false;
- // Some variables for sizing test numbers in bits
- private static int order1 = 100;
- private static int order2 = 60;
- private static int order3 = 30;
@tbuktu
tbuktu / BigInteger.java.phase3
Created January 7, 2012 20:58
Patched BigInteger using efficient algorithms for multiplication and division
/*
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
@tbuktu
tbuktu / BigInteger.java.patch
Created January 7, 2012 20:55
BigInteger patch for efficient multiplication and division (bug #4837946)
--- jdk8/jdk/src/share/classes/java/math/BigInteger.java 2012-12-28 20:43:25.314218154 +0100
+++ src/main/java/java/math/BigInteger.java 2012-12-28 14:59:56.049558654 +0100
@@ -94,6 +94,9 @@
* @see BigDecimal
* @author Josh Bloch
* @author Michael McCloskey
+ * @author Alan Eliasen
+ * @author Timothy Buktu
+
* @since JDK1.1