aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/math
AgeCommit message (Collapse)AuthorFilesLines
2004-10-16BigDecimal.java, [...]: Reorganized import statements, removed redundant and ↵Michael Koch2-38/+34
reorganized modifiers. 2004-10-16 Michael Koch <konqueror@gmx.de> * java/math/BigDecimal.java, java/math/BigInteger.java: Reorganized import statements, removed redundant and reorganized modifiers. From-SVN: r89149
2004-05-03URLStreamHandler.java (toExternalForm): Removed unused variables.Tom Tromey1-1/+0
2004-05-03 Tom Tromey <tromey@redhat.com> * java/net/URLStreamHandler.java (toExternalForm): Removed unused variables. unused constructor. * java/math/BigDecimal.java (divide): Removed unused variable. * java/lang/Throwable.java: Cleaned up imports. * java/lang/ClassLoader.java: Cleaned up imports. * java/io/FilePermission.java (implies): Removed unused variable. * java/awt/TextComponent.java: Removed unused import. * gnu/java/util/prefs/NodeReader.java: Cleaned up imports. * gnu/java/util/DoubleEnumeration.java: Removed unused import. * gnu/java/text/WordBreakIterator.java: Removed unused import. * gnu/java/text/SentenceBreakIterator.java: Removed unused import. * gnu/java/text/LineBreakIterator.java: Removed unused import. * gnu/java/text/CharacterBreakIterator.java: Removed unused import. * gnu/java/security/provider/DSAKeyPairGenerator.java: Cleaned up imports. * gnu/java/security/der/DERWriter.java: Cleaned up imports. * gnu/java/nio/charset/UTF_16Decoder.java (put): Removed unused method. * gnu/java/nio/SocketChannelImpl.java: Cleaned up imports. * gnu/java/nio/FileLockImpl.java: Cleaned up imports. * gnu/java/io/Base64InputStream.java: Cleaned up imports. * gnu/java/beans/info/ComponentBeanInfo.java: Cleaned up imports. * gnu/classpath/ServiceFactory.java: Cleaned up imports. (lookupProviders): Removed unused variable. (loadNextServiceProvider): Likewise. * gnu/java/beans/BeanInfoEmbryo.java: Cleaned up imports. From-SVN: r81450
2003-11-11Font.java, [...]: Removed some redundant obj == null checks.Michael Koch1-1/+1
2003-11-11 Michael Koch <konqueror@gmx.de> * java/awt/Font.java, java/awt/datatransfer/DataFlavor.java, java/math/BigInteger.java, java/net/Inet4Address.java, java/net/Inet6Address.java, java/rmi/MarshalledObject.java, java/rmi/server/RMIClassLoader.java, java/security/cert/CertStore.java, java/sql/Timestamp.java, java/text/SimpleDateFormat.java, javax/naming/CompoundName.java: Removed some redundant obj == null checks. From-SVN: r73448
2003-10-092003-10-09 Michael Koch <konqueror@gmx.de>Michael Koch1-1/+0
* java/math/BigInteger.java (add): Removed unused local variable len. From-SVN: r72263
2003-08-01BigDecimal (divide): Correctly handle ROUND_HALF_EVEN when amount is greater ↵Jerry Quinn1-35/+38
than 0.5. 2003-08-01 Jerry Quinn <jlquinn@optonline.net> Mark Wielaard <mark@klomp.org> * java/math/BigDecimal (divide): Correctly handle ROUND_HALF_EVEN when amount is greater than 0.5. Simplify and optimize code. Co-Authored-By: Mark Wielaard <mark@klomp.org> From-SVN: r70049
2003-04-19BigInteger.java (probablePrime): New.Jerry Quinn2-0/+22
2003-04-19 Jerry Quinn <jlquinn@optonline.net> * java/math/BigInteger.java (probablePrime): New. * java/math/BigDecimal.java (unscaledValue): New. From-SVN: r65825
2003-02-20BigInteger.java (euclidInv): Take result array as an argument.Raif S. Naffah1-16/+13
2003-02-20 Raif S. Naffah <raif@fl.net.au> * java/math/BigInteger.java (euclidInv): Take result array as an argument. Updated all callers. (modInverse): Removed unused variables. From-SVN: r63170
2003-02-17BigInteger.java (euclidInv): Return array of `BigInteger's.Raif S. Naffah1-18/+15
2003-02-17 Raif S. Naffah <raif@fl.net.au> * java/math/BigInteger.java (euclidInv): Return array of `BigInteger's. Changed all callers. From-SVN: r63014
2003-02-14BigDecimal.java (BigDecimal(String)): Always set scale to zero when there is ↵Mark Wielaard1-2/+4
an exponent and the significant is zero. * java/math/BigDecimal.java (BigDecimal(String)): Always set scale to zero when there is an exponent and the significant is zero. (divide): Always set scale to newScale even in special ZERO case. From-SVN: r62908
2003-02-10BigInteger.java: Updated notice to include years 2002 and 3.Raif S. Naffah1-181/+130
2003-02-10 Raif S. Naffah <raif@fl.net.au> * java/math/BigInteger.java: Updated notice to include years 2002 and 3. Added 2 private (int) arrays with values from the HAC (Handbook of Applied Cryptography -A. Menezes & al): k[] that contains bit lengths and t[] that contains nbr. of tests --used in isProbablePrime(). * java/math/BigInteger.java (make(long)): Merged into valueOf(long). * java/math/BigInteger.java (make(int[],int), add(int,int), add(BI,BI,int), times(BI,int), divide(long,long,BI,BI,int), gcd(BI), isProbablePrime(int), shift(BI,int), valueOf(String,int), neg(BI), bitOp(int,BI,BI), and(BI,int)): Use valueOf(long) instead of make(long). * java/math/BigInteger.java (euclidInv): Reduce number of work vars (euclidInv(int,int,int)): Now returns an array of 2 ints instead of 3. (euclidInv(BI,BI,BI)): Used to return an array of 2 BIs; now accepts 6 BIs and returns void. (modInverse(BI)): Use new signatures of euclidInv(). * java/math/BigInteger.java (isProbablePrime(int)): Use divide() with static small primes instead of remainder(). Use pre-computed max nbr of trials based on bitlength of BI to test. Use pre-computed small primes for the trial tests instead of random numbers. * java/math/BigInteger.java (isOdd, isMinusOne, pow): Removed. not used. * java/math/BigInteger.java (format(int,StringBuffer)): Removed invoacation of MPN.chars_per_word(). not used. * java/math/BigInteger.java (gcd(int,int)): Declared 'tmp' once as local var and used where needed. * java/math/BigInteger.java (modPow(BI,BI)): Fixed spelling. Combined declaration with initialisation of locals. Removed unused var. * java/math/BigInteger.java: Style changes (pow(int)): Removed 'else' keyword. (toString(int)): idem. (doubleValue()): idem. (bitLength()): idem. (equals(Object)): Use static methods name in same class w/o prepending class name. (doubleValue()): idem. (setNegative(BI)): idem. (negate()): idem. (and(BI,int)): idem. (and(BI)): idem. (gcd(BI)): idem. (byteArrayToIntArray()): Removed casting to (int). this is std. behaviour. (canonicalize()): idem. (alloc(int)): Always instantiate a new BI. From-SVN: r62656
2003-02-07BigDecimal (valueOf): fix DiagBigDecimal val008, val013 tests; see patch ↵Stephen Crawley1-18/+42
#1016 on Savannah. 2003-02-07 Stephen Crawley <crawley@dstc.edu.au> * java/math/BigDecimal(valueOf): fix DiagBigDecimal val008, val013 tests; see patch #1016 on Savannah. 2003-02-07 Stephen Crawley <crawley@dstc.edu.au> * java/math/BigDecimal.java (BigDecimal): enhance parsing of exponents (toString): do not return Strings starting with . and - erroneously. Improves Mauve results to 12 of 600 instead of 16 of 338 on DiagBigDecimal. From-SVN: r62540
2002-12-19BigInteger.java (euclidInv): Make sure quot and rem are in canonical form ↵Raif Naffah1-0/+6
after divide(). 2002-12-18 Raif Naffah <raif@fl.net.au> * java/math/BigInteger.java (euclidInv): Make sure quot and rem are in canonical form after divide(). (modInverse): Likewise. From-SVN: r60292
2002-02-14[multiple changes]Mark Wielaard1-1/+1
2002-02-14 Mark Wielaard <mark@klomp.org> * java/math/BigInteger.java: import gnu.java.math.MPN not the whole package as a workaround for gcj 3.0.x 2002-02-14 Mark Wielaard <mark@klomp.org> * java/security/BasicPermission.java: extends with fully qualified classname as workaround for gcj 3.0.4. 2002-02-14 Eric Blake <ebb9@email.byu.edu> * java/net/DatagramSocketImpl.java (setOption, getOption): Work around gcj bug of wrong emitted qualifier for inherited method. * java/net/SocketImpl.java (setOption, getOption): Ditto. * java/util/WeakHashMap.java (WeakEntrySet): Add non-private constructor to reduce amount of emitted bytecode. While this happens to work around a jikes 1.15 bug, it is still a useful patch even for correct compilers. * java/rmi/server/RMIClassLoader.java (MyClassLoader): Ditto. * gnu/java/rmi/server/UnicastRemoteCall.java (DummyObjectOutputStream, DummyObjectInputStream): Ditto. 2002-02-14 Eric Blake <ebb9@email.byu.edu> * java/net/DatagramSocketImpl.java: Reformat (no code changes). * java/net/SocketImpl.java: Ditto. * java/rmi/server/RMIClassLoader.java: Ditto. * gnu/java/rmi/server/UnicastRemoteCall.java: Ditto. 2002-02-14 Mark Wielaard <mark@klomp.org> Thanks to Takashi Okamoto * java/util/Arrays.java (ArrayList.indexOf()): this.equals(). * java/util/Arrays.java (ArrayList.lastIndexOf()): Likewise. * java/util/WeakHashMap.java (WeakEntry.getEntry()): this.get(). From-SVN: r49778
2002-01-22Add license clarification.Mark Wielaard2-10/+32
From-SVN: r49104
2001-12-16Makefile.in: Rebuilt.Tom Tromey1-11/+27
* Makefile.in: Rebuilt. * Makefile.am (ordinary_java_source_files): Removed old file; added new file. * gnu/java/math/MPN.java: New file. * gnu/gcj/math/MPN.java: Removed. * java/math/BigInteger.java: Merged with Classpath. From-SVN: r48080
2001-11-25re PR libgcj/4583 (problems BigDecimal(double) ctor.)Tom Tromey1-8/+111
Fix for PR libgcj/4583: * java/math/BigDecimal.java (BigDecimal(double)): Rewrote. (BigDecimal(String)): Likewise. From-SVN: r47329
2001-08-28BigInteger.java (init(int,Random)): New method.Per Bothner1-13/+27
* java/math/BigInteger.java (init(int,Random)): New method. Move body of constructor <init>(int,Random)) here. Re-write it to avoid constructing unneeded temporaries. (<init>(int,int,Random)): Use new init method to avoid constructing extra temporary BigIntegers. From-SVN: r45240
2001-08-17BigInteger.java (randBytes): New method.Mark J Roberts1-12/+11
2001-08-17 Mark J Roberts <mjr@anarcast.net> * java/math/BigInteger.java (randBytes): New method. (BigInteger(int,Random)): Use randBytes. From-SVN: r44984
2001-08-17* BigInteger.java: fix right shifts by nonzero multiples of 32.Hans Boehm1-1/+1
From-SVN: r44963
2001-06-19BigInteger.java (byteArrayToIntArray): Don't include extraneous/malformed ↵Mark J. Roberts1-5/+1
sign word. 2001-06-19 Mark J. Roberts <mjr@statesmean.com> * java/math/BigInteger.java (byteArrayToIntArray): Don't include extraneous/malformed sign word. From-SVN: r43455
2001-03-01Changes merged from Kawa's gnu.math.Per Bothner1-15/+10
* java/math/BigInteger.java * gnu/gcj/math/MPN.java (rshift0): New method handles zero shift count. (rshift(int[],int[],int,int): Removed - not needed. (gcd): Use rshift0 rather than rshift. * java/math/BigInteger.java (setShiftRight): Likewise. (divide): Simplify by using rshift0. (divide): Zero-extend results if high-order bit set. From-SVN: r40177
2001-01-17* java/math/BigInteger.java: Update Copyright year.Warren Levy1-1/+1
From-SVN: r39082
2001-01-17BigInteger.java (setShiftRight): Only do negative shift if count != 0.Hans Boehm1-4/+6
2001-01-16 Hans Boehm <hans_boehm@hp.com> * java/math/BigInteger.java (setShiftRight): Only do negative shift if count != 0. From-SVN: r39080
2001-01-10* java/math/BigDecimal.java (divide): Fixed comment.Warren Levy1-1/+1
From-SVN: r38862
2001-01-10re PR libgcj/1596 (setScale() missing from java.math.BigDecimal)Warren Levy1-6/+28
Fix for PR libgcj/1596: * java/math/BigDecimal.java (divide): Check newScale for validity. Ensure that BigInteger.pow() is called with a non-negative value. (setScale (int)): New public method. (setScale (int,int)): New public method. From-SVN: r38861
2000-10-27Makefile.am: Added locale files from Classpath.Warren Levy2-23/+55
* Makefile.am: Added locale files from Classpath. * Makefile.in: Rebuilt. * gnu/java/locale/Calendar.java: New file. * gnu/java/locale/Calendar_de.java: New file. * gnu/java/locale/Calendar_en.java: New file. * gnu/java/locale/Calendar_nl.java: New file. * java/lang/ClassNotFoundException.java: Replaced with Classpath file. * java/math/BigDecimal.java (intVal): Renamed from 'num' for serialization compatibility. (scale): Made private. (serialVersionUID): New field. * java/math/BigInteger.java (ival): Made transient. (words): Made transient. (bitCount): New serialization field. (bitLength): Ditto. (firstNonzeroByteNum): Ditto. (lowestSetBit): Ditto. (magnitude): Ditto. (signum): Ditto. (serialVersionUID): New field. (readObject): New method. (writeObject): New method. * java/util/BitSet.java (serialVersionUID): New field. * java/util/Calendar.java: Replaced with Classpath file. * java/util/GregorianCalendar.java (GregorianCalendar): Pass result of getDefault() for TimeZone or Locale instead of passing nulls. * java/util/Locale.java (serialVersionUID): New field. (writeObject): New method. (readObject): New method. * java/util/SimpleTimeZone.java: Replaced with Classpath file. Serialization mods. From-SVN: r37080
2000-04-11ObjectStreamException.java: New file.Warren Levy1-0/+348
* java/io/ObjectStreamException.java: New file. * java/io/OptionalDataException.java: New file. * java/io/StreamCorruptedException.java: New file. * java/math/BigDecimal.java: New file. * java/sql/CallableStatement.java: New file. * java/sql/Connection.java: New file. * java/sql/DataTruncation.java: New file. * java/sql/DatabaseMetaData.java: New file. * java/sql/Date.java: New file. * java/sql/Driver.java: New file. * java/sql/DriverManager.java: New file. * java/sql/DriverPropertyInfo.java: New file. * java/sql/PreparedStatement.java: New file. * java/sql/ResultSet.java: New file. * java/sql/ResultSetMetaData.java: New file. * java/sql/SQLException.java: New file. * java/sql/SQLWarning.java: New file. * java/sql/Statement.java: New file. * java/sql/Time.java: New file. * java/sql/Timestamp.java: New file. * java/sql/Types.java: New file. * Makefile.am: Added above new files. * Makefile.in: Rebuilt. * mauve-libgcj: Turned on java.math, java.sql and java.security tests. * java/net/MulticastSocket.java (MulticastSocket): Pass values a la DatagramSocket constructor instead of null. java.sql is JDK 1.1 Compliant From-SVN: r33077
2000-03-24BigInteger.java (divide): Handle the special case when dividing by 1 and the ↵Warren Levy1-2/+11
high bit of the dividend is set. * java/math/BigInteger.java(divide): Handle the special case when dividing by 1 and the high bit of the dividend is set. (setShiftRight): Handle case when count == 0. From-SVN: r32724
2000-03-09* java/math/BigInteger.java(signum): Handle zero properly.Warren Levy1-1/+3
From-SVN: r32441
2000-03-07All files: Updated copyright information.Tom Tromey1-1/+1
* All files: Updated copyright information. * COPYING: New file. * COPYING.LIB: Removed. * LIBGCJ_LICENSE: We now use GPL + special exception. From-SVN: r32387
2000-02-25BigInteger.java (ival): Made private.Warren Levy1-3/+3
* java/math/BigInteger.java(ival): Made private. (words): Ditto. (neg): Ditto. From-SVN: r32143
2000-02-14MPN.java (findLowestBit): Made methods public.Warren Levy1-20/+154
* gnu/gcj/math/MPN.java(findLowestBit): Made methods public. * java/math/BigInteger.java(BigInteger(int,int,java.util.Random): New constructor. (min): Implemented. (max): Implemented. (modPow): Rewritten to not use the naive, slow, brute force approach. (isProbablePrime): Implemented. (testBit): Implemented. (flipBit): Implemented. (getLowestSetBit): Implemented. From-SVN: r31966
2000-02-11BigInteger.java (BigInteger(String, int)): New constructor.Warren Levy1-24/+400
* java/math/BigInteger.java(BigInteger(String, int)): New constructor. (BigInteger(String)): New constructor. (not): Rewritten using version from Kawa's BitOps class. (valueOf): New private methods from Kawa's BitOps class. (swappedOp): ditto. (bitOp): ditto. (setBitOp): ditto. (and): Implemented. (or): Implemented. (xor): Implemented. (andNot): Implemented. (clearBit): Implemented. (setBit): Implemented. (bitCount): Implemented. (toByteArray): Implemented. From-SVN: r31926
2000-02-04Makefile.am: Added MPN.java and BigInteger.java.Warren Levy1-0/+1683
* Makefile.am: Added MPN.java and BigInteger.java. * Makefile.in: Rebuilt. * gnu/gcj/math/MPN.java: New file. * java/math/BigInteger.java: New file. From-SVN: r31794