Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ba286b58ba18
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2959bff54ed2
Choose a head ref
  • 2 commits
  • 5 files changed
  • 1 contributor

Commits on Jan 5, 2016

  1. 3
    Copy the full SHA
    66a595d View commit details
  2. Copy the full SHA
    2959bff View commit details
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/marshal/dump_tags.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
fails:Marshal.dump dumps an extended_object
fails:Marshal.dump with a Float dumps a Float
fails:Marshal.dump with a String dumps a String extended with a Module
fails:Marshal.dump with a Regexp dumps a Regexp
fails:Marshal.dump with a Regexp dumps a Regexp with flags
@@ -19,4 +18,3 @@ fails:Marshal.dump with an Exception dumps the message for the exception
fails:Marshal.dump with an Exception contains the filename in the backtrace
fails:Marshal.dump with a Symbol dumps a binary encoded Symbol
fails:Marshal.dump with a String dumps a String subclass extended with a Module
fails:Marshal.dump with an Object dumps an Object that has had an instance variable added and removed as though it was never set
3 changes: 0 additions & 3 deletions spec/truffle/tags/core/marshal/float_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/marshal/load_tags.txt
Original file line number Diff line number Diff line change
@@ -17,5 +17,4 @@ fails:Marshal.load when called with a proc returns the value of the proc
fails:Marshal.load when called with a proc calls the proc for recursively visited data
fails:Marshal.load when called with a proc loads an Array with proc
fails:Marshal.load for a Hash loads an extended hash object containing a user-marshaled object
fails:Marshal.load for a Time loads the zone
fails:Marshal.load when a class does not exist in the namespace raises an ArgumentError
1 change: 0 additions & 1 deletion spec/truffle/tags/core/marshal/restore_tags.txt
Original file line number Diff line number Diff line change
@@ -17,5 +17,4 @@ fails:Marshal.restore when called with a proc returns the value of the proc
fails:Marshal.restore when called with a proc calls the proc for recursively visited data
fails:Marshal.restore when called with a proc loads an Array with proc
fails:Marshal.restore for a Hash loads an extended hash object containing a user-marshaled object
fails:Marshal.restore for a Time loads the zone
fails:Marshal.restore when a class does not exist in the namespace raises an ArgumentError
Original file line number Diff line number Diff line change
@@ -39,19 +39,28 @@ public FloatDToAPrimitiveNode(RubyContext context, SourceSection sourceSection)
@TruffleBoundary
@Specialization
public DynamicObject dToA(double value) {
String string = String.format(Locale.ENGLISH, "%.9f", value);
// Large enough to print all digits of Float::MIN.
String string = String.format(Locale.ENGLISH, "%.1022f", value);

if (string.toLowerCase(Locale.ENGLISH).contains("e")) {
throw new UnsupportedOperationException();
}

string = string.replace("-", "");
while (string.charAt(string.length() - 1) == '0') {
string = string.substring(0, string.length() - 1);
}

final int decimal;
int decimal;

if (string.startsWith("0.")) {
string = string.replace("0.", "");
decimal = 0;

while (string.charAt(0) == '0') {
string = string.substring(1, string.length());
--decimal;
}
} else {
decimal = string.indexOf('.');