History log of /libcore/luni/src/main/java/java/lang/StrictMath.java
Revision Date Author Comments
744681303401b72671c33425a72676a053733a06 02-Feb-2013 Elliott Hughes <enh@google.com> Fix the documentation for Math/StrictMath ceil/floor.

Bug: https://code.google.com/p/android/issues/detail?id=44080
Change-Id: I426b723a7aa36a16aed7baf36fd907786799c91a
bf9c47975631cda6ead2eda00d3db3c93444eeba 14-Sep-2012 Elliott Hughes <enh@google.com> Manually inline StrictMath.min(JJ) and StrictMath.max(JJ).

Also add new intrinsic tests.

Bug: 7146208
Change-Id: Ic454c8c5b218c51ce1c21f0c11163455392b4e72
08343a4ef77616fc420e51d1095c0d6a266041ba 16-Feb-2011 Elliott Hughes <enh@google.com> Remove our implementations of inline natives.

It turns out that our String.equals was getting used. Making dalvikvm's inline
natives be native methods ensures that doesn't happen.

I've also added a test to ensure we explicitly test both variants.

Change-Id: Ie2a4b5289092da5ffca4a4273692f1048ab3b841
0d4ce4227fa818288b8db762b640dfa21e3162f5 12-Jan-2011 Elliott Hughes <enh@google.com> Change all "final static"s to "static final".

Just so we sound like native speakers.

Change-Id: I4d98ec7519af8c1578609945ca9d480484b82874
2fc5dcd5614f910f25d794d272834752a72e63b1 09-Dec-2010 Elliott Hughes <enh@google.com> Apply various Intellij quick fixes to java.lang.

There's one real bug here: our Integer.toString was supposed to have a cache
for small negative values, but an accidentally-introduced temporary meant we
were never using the cached values. Other than that, this is just cleanup.

Change-Id: I457f9bd166c9a029ba8b439f3bbfa926f9b84cc9
706de1164836051ab31cc69eb77a6bba1a723896 27-Aug-2010 Elliott Hughes <enh@google.com> Minor tidy-up of Float.toString and Double.toString.

This patch looks larger than it is. I've moved duplicated constants out of
Math and StrictMath and into Float and Double where they belong. I've also
moved a table out of BigDecimal so I can reuse it in NumberConverter, which
I've renamed to RealToString.

The main active ingredient here is that there's no longer StringBuilder usage
to prepend '-'. This actually brings us down from 74ns to 62ns for an easy
case like 123.45f.

[cherry-pick of 910106e29fe98f14b2c36312a7498287273ba826 from dalvik-dev to gingerbread; plus build fix]

Bug: 2934304
Change-Id: Id79a6fb0d739e673b7428d240fc48bdae9b8bb43
d16c314465f7f5905fe8852eaa09d4e7e14ec835 25-Aug-2010 Elliott Hughes <enh@google.com> Faster implementations of Math/StrictMath's copySign methods.

These are only faster than the old native implementations now we have
intrinsics for float/int and double/long conversion, but given those,
they're about 4x faster.

We were already using Java for getExponent, the other obvious candidate
for an all-Java implementation.

[cherry-pick of a61c63c54ba46bb8a1dcbd888e3b29d6cedfb1ff from dalvik-dev to gingerbread]

Bug: 2935622
910106e29fe98f14b2c36312a7498287273ba826 27-Aug-2010 Elliott Hughes <enh@google.com> Minor tidy-up of Float.toString and Double.toString.

This patch looks larger than it is. I've moved duplicated constants out of
Math and StrictMath and into Float and Double where they belong. I've also
moved a table out of BigDecimal so I can reuse it in NumberConverter, which
I've renamed to RealToString.

The main active ingredient here is that there's no longer StringBuilder usage
to prepend '-'. This actually brings us down from 74ns to 62ns for an easy
case like 123.45f.

Bug: 2934304
Change-Id: I65461753247eeb9ff890ffe66b0bc79d66d2ec9c
a61c63c54ba46bb8a1dcbd888e3b29d6cedfb1ff 25-Aug-2010 Elliott Hughes <enh@google.com> Faster implementations of Math/StrictMath's copySign methods.

These are only faster than the old native implementations now we have
intrinsics for float/int and double/long conversion, but given those,
they're about 4x faster.

We were already using Java for getExponent, the other obvious candidate
for an all-Java implementation.

Bug: 2935622
Change-Id: I77549c88b7448b6087a67b37f8c317579b4f92b8
7365de1056414750d0a7d1fdd26025fd247f0d04 12-Aug-2010 Jesse Wilson <jessewilson@google.com> Sorting imports.

Change-Id: I8347bc625480a1c37a1ed9976193ddfedeb00bbc
162a12c1442641a95fe95859fa4e561b22db049f 25-May-2010 Elliott Hughes <enh@google.com> Remove @hide from Java 6 API.

I've left the two new spi packages @hidden, because I think we shouldn't
support them without convincing demand from developers (and I don't
believe there could be such a thing --- they just don't make sense, and
if we add anything, it should be the ability to provide extra ICU data).

Also fix a handful of javadoc syntax errors in Arrays.java and TreeMap.java.

Bug: 2497395
Change-Id: I4176b72daff0face4ed6c7ee1d1f4267d52006b4
f33eae7e84eb6d3b0f4e86b59605bb3de73009f3 13-May-2010 Elliott Hughes <enh@google.com> Remove all trailing whitespace from the dalvik team-maintained parts of libcore.

Gentlemen, you may now set your editors to "strip trailing whitespace"...

Change-Id: I85b2f6c80e5fbef1af6cab11789790b078c11b1b
eeefcae2980c8db05ec08303b5b112afce232d26 06-May-2010 Elliott Hughes <enh@google.com> Remove the "Answers" javadoc barbarism.

I didn't realize how little of it was left, or I'd have done this earlier.

Change-Id: Ic4c23c3779bbee0ed4a8117584c5332e04536b5d
abd91e389e4462208eb004b38d378f67d9676ec1 30-Mar-2010 Elliott Hughes <enh@google.com> Fix build.

Rather than try to be clever with header files (which didn't work with glibc
for the sim build) let's make Math.copySign have the StrictMath behavior,
and have StrictMath call Math. (The other way round, though it might seem
more logical, wouldn't solve the problem. We already have numerous cases of
StrictMath calling Math anyway.)

Change-Id: Ifff065ddc8fbd5d5f8d4d5b67bc9ac07a719eb00
ace7e6ff6285c073a80aaad68321b17bdcd09a4b 27-Mar-2010 Elliott Hughes <enh@google.com> Fix StrictMath.copySign's behavior with NaN.

StrictMath's copySign method is defined to treat all NaNs as positive, regardless
of their sign bit. Rather than add yet more code on the Java side (which already
called down to native code three times), let's just make one call to native code.

This change fixes failures in already-committed StrictMath tests.

The only other potential instances of this class of error were in the
max and min methods, but they all handle NaNs before calling
(double|float)To(Raw)?LongBits, so the choice there really is arbitrary.

Change-Id: I439dbdff9068cb420b78a6330cde9d7d0d12c0ef
5820c2d5ea8199005b9c1c9dbf34b3d5cdbb8c10 11-Mar-2010 Elliott Hughes <enh@google.com> Tidy up java.lang.Math and java.lang.StrictMath.

Removes duplication, fixes typos, and removes some unnecessary object creation.
Note that otherwise-duplicated code that calls a native method needs to remain
duplicated, because the native methods have different implementations. Other
than that, it's not clear to me that the remaining textual differences (mainly
scalb and its implementation details) are meaningful, but it's not clear that
they're not, so I'm leaving them for now. We can always come back later.

This new code still passes all the junit and jtreg tests.

Change-Id: Ica28a01fd1469a162e05deccdb9e6f919246d9f3
73342e0a7adba5a494309c1fcee0c64fee4f79f1 11-Mar-2010 Elliott Hughes <enh@google.com> Copy harmony's jdk6 Math and StrictMath.

There's some ugliness here I want to remove, but it'll be less confusing if
I commit the upstream code first without my changes...

...that said, I've reverted the upstream Math.pow change because it it's just
cruft; we already pass their tests and jtreg's more thorough pow tests (see
http://blogs.sun.com/darcy/entry/finding_a_bug_in_fdlibm). My guess is that
their real problem was that they were using the buggy fdlibm 5.2 until after
they made the Math.pow change. We've always used 5.3, so we were fine.

Change-Id: I5a6c080d9fd6b60dc7bf77ac10096a913766f512
55392539fea537abfb6581b474918f9d611fba27 16-Dec-2009 Jesse Wilson <jessewilson@google.com> Update luni package to Harmony r888752.

Conflicts:
libcore/luni/META-INF/MANIFEST.MF
libcore/luni/make/findbugs-exclude-filter.xml
libcore/luni/src/main/java/java/io/BufferedOutputStream.java
libcore/luni/src/main/java/java/io/BufferedReader.java
libcore/luni/src/main/java/java/io/CharArrayReader.java
libcore/luni/src/main/java/java/io/StringReader.java
libcore/luni/src/main/java/java/lang/StrictMath.java
libcore/luni/src/main/java/java/lang/ref/ReferenceQueue.java
libcore/luni/src/main/java/java/net/Inet4Address.java
libcore/luni/src/main/java/java/net/InetAddress.java
libcore/luni/src/main/java/java/util/ArrayList.java
libcore/luni/src/main/java/java/util/EnumSet.java
libcore/luni/src/main/java/java/util/HugeEnumSet.java
libcore/luni/src/main/java/org/apache/harmony/luni/internal/reflect/ProxyConstantPool.java
libcore/luni/src/main/java/org/apache/harmony/luni/platform/AbstractMemorySpy.java
libcore/luni/src/main/java/org/apache/harmony/luni/platform/DebugMemorySpy.java
libcore/luni/src/main/java/org/apache/harmony/luni/platform/Endianness.java
libcore/luni/src/main/java/org/apache/harmony/luni/platform/IFileSystem.java
libcore/luni/src/main/java/org/apache/harmony/luni/platform/IMemorySystem.java
libcore/luni/src/main/java/org/apache/harmony/luni/platform/INetworkSystem.java
libcore/luni/src/main/java/org/apache/harmony/luni/platform/IPlatformConstants.java
libcore/luni/src/main/java/org/apache/harmony/luni/platform/OSFileSystem.java
libcore/luni/src/main/java/org/apache/harmony/luni/platform/OSMemory.java
libcore/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java
libcore/luni/src/main/java/org/apache/harmony/luni/util/InputStreamExposer.java
libcore/luni/src/main/native/hyzip/shared/zipcache.c
libcore/luni/src/main/native/hyzip/shared/zipsup.c
libcore/luni/src/main/native/include/jni.h
libcore/luni/src/main/native/include/jni_types.h
libcore/luni/src/main/native/include/jvmti.h
libcore/luni/src/main/native/include/jvmti_types.h
libcore/luni/src/main/native/launcher/unix/main_hlp.c
libcore/luni/src/main/native/luni/shared/OSNetworkSystem.c
libcore/luni/src/main/native/luni/shared/file.c
libcore/luni/src/main/native/luni/windows/makefile
libcore/luni/src/test/api/unix/org/apache/harmony/luni/tests/java/io/UnixFileTest.java
libcore/luni/src/test/java/tests/api/java/io/BufferedOutputStreamTest.java
libcore/luni/src/test/java/tests/api/java/io/BufferedReaderTest.java
libcore/luni/src/test/java/tests/api/java/io/SerializationStressTest.java
libcore/luni/src/test/java/tests/api/java/net/SocketTest.java
libcore/luni/src/test/java/tests/api/java/util/ArrayListTest.java
libcore/luni/src/test/java/tests/api/java/util/EnumSetTest.java
libcore/luni/src/test/java/tests/api/java/util/TimerTest.java
4fefecee9d4a5d2a4510f516b4015607b19e8d09 13-Nov-2009 Jean-Baptiste Queru <jbq@google.com> eclair snapshot
f5597e626ecf7949d249dea08c1a2964d890ec11 25-Jul-2009 Jesse Wilson <jessewilson@google.com> Integrate luni module (but not tests) to Harmony r772995.

Notable changes
- Stripped "@since Android 1.0" from many files. Most files
are now 100% the same in Dalvik and Harmony.
- AbstractStringBuilder.reverse() supports surrogates
- AbstractStringBuilder shares less to waste less memory
- Bitset optimized
- BufferedInputStream changed to support unsynchronized close()
- BufferedOutputStream does flushInternal
- BufferedReader supports EBCDIC NEL
- Collections.synchronizedList().indexOf() does a copy for more concurrency
- Classes in nio module changed: DatagramChannelImpl, SocketChannelImpl
and ServerSocketChannelImpl (these depend on internal APIs changed in
this update)
- DataInputStream/DataOutputStream now use a small buffer to limit the
number of times the underlying stream is accessed
- Date now has a minutes offset, more efficient toString()
- ExposedByteArrayInputStream: new internal class
- DeleteOnExit moved to top-level class
- FileDescriptor.isValid() now non-native
- Float, Double lessThan optimized (fix for compare(-0.0F, 0.0F) still pending)
- FileURLConnection now guesses content types from streams
- HashMap iterator changes
- Hashtable iterator changes
- INetworkSystem
- removes bind2(), createMulticastSocket, sendStream(),
- renames createSocket to createStreamSocket
- JarURLConnection rewritten
- LinkedHashMap: new iterator
- Locale, Currency, TimeZone: now use ICU in Harmony, plain Java in Dalvik
- ObjectInputStream: Accessor objects in Harmony, direct native in Dalvik
- ProxyClassFile - many changes
- String - optimized ascii for toLowerCase, toUpperCase, compare
- Timer - rewritten
- TreeMap - rewritten
- URLClassLoader - new
- URLConnection - new guessContentTypeFromStream(), uses org.apache.harmony.awt.www.content
to lookup content type handlers
adc854b798c1cfe3bfd4c27d68d5cee38ca617da 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
1c0fed63c71ddb230f3b304aac12caffbedf2f21 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
dd828f42a5c83b4270d4fbf6fce2da1878f1e84a 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
fdb2704414a9ed92394ada0d1395e4db86889465 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution