mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	merge revision(s) 58796: [Backport #13545]
Merge latest dtoa.c [Bug #13545] Apply some part of http://www.netlib.org/fp/dtoa.c with my eyes... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@59298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									5528c18ded
								
							
						
					
					
						commit
						c54593eddb
					
				
					 3 changed files with 10 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -16,6 +16,8 @@ class TestFloat < Test::Unit::TestCase
 | 
			
		|||
    assert_in_delta(13.4 % 1, 0.4, 0.0001)
 | 
			
		||||
    assert_equal(36893488147419111424,
 | 
			
		||||
                 36893488147419107329.0.to_i)
 | 
			
		||||
    assert_equal(1185151044158398820374743613440,
 | 
			
		||||
                 1.1851510441583988e+30.to_i)
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def nan_test(x,y)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										12
									
								
								util.c
									
										
									
									
									
								
							
							
						
						
									
										12
									
								
								util.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -2109,7 +2109,7 @@ break2:
 | 
			
		|||
    for (nd = nf = 0; (c = *s) >= '0' && c <= '9'; nd++, s++)
 | 
			
		||||
        if (nd < 9)
 | 
			
		||||
            y = 10*y + c - '0';
 | 
			
		||||
        else if (nd < 16)
 | 
			
		||||
        else if (nd < DBL_DIG + 2)
 | 
			
		||||
            z = 10*z + c - '0';
 | 
			
		||||
    nd0 = nd;
 | 
			
		||||
#ifdef USE_LOCALE
 | 
			
		||||
| 
						 | 
				
			
			@ -2149,17 +2149,19 @@ break2:
 | 
			
		|||
        for (; c >= '0' && c <= '9'; c = *++s) {
 | 
			
		||||
have_dig:
 | 
			
		||||
            nz++;
 | 
			
		||||
            if (nd > DBL_DIG * 4) continue;
 | 
			
		||||
            if (nd > DBL_DIG * 4) {
 | 
			
		||||
		continue;
 | 
			
		||||
	    }
 | 
			
		||||
            if (c -= '0') {
 | 
			
		||||
                nf += nz;
 | 
			
		||||
                for (i = 1; i < nz; i++)
 | 
			
		||||
                    if (nd++ < 9)
 | 
			
		||||
                        y *= 10;
 | 
			
		||||
                    else if (nd <= DBL_DIG + 1)
 | 
			
		||||
                    else if (nd <= DBL_DIG + 2)
 | 
			
		||||
                        z *= 10;
 | 
			
		||||
                if (nd++ < 9)
 | 
			
		||||
                    y = 10*y + c;
 | 
			
		||||
                else if (nd <= DBL_DIG + 1)
 | 
			
		||||
                else if (nd <= DBL_DIG + 2)
 | 
			
		||||
                    z = 10*z + c;
 | 
			
		||||
                nz = 0;
 | 
			
		||||
            }
 | 
			
		||||
| 
						 | 
				
			
			@ -2247,7 +2249,7 @@ ret0:
 | 
			
		|||
 | 
			
		||||
    if (!nd0)
 | 
			
		||||
        nd0 = nd;
 | 
			
		||||
    k = nd < DBL_DIG + 1 ? nd : DBL_DIG + 1;
 | 
			
		||||
    k = nd < DBL_DIG + 2 ? nd : DBL_DIG + 2;
 | 
			
		||||
    dval(rv) = y;
 | 
			
		||||
    if (k > 9) {
 | 
			
		||||
#ifdef SET_INEXACT
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
#define RUBY_VERSION "2.4.2"
 | 
			
		||||
#define RUBY_RELEASE_DATE "2017-07-10"
 | 
			
		||||
#define RUBY_PATCHLEVEL 138
 | 
			
		||||
#define RUBY_PATCHLEVEL 139
 | 
			
		||||
 | 
			
		||||
#define RUBY_RELEASE_YEAR 2017
 | 
			
		||||
#define RUBY_RELEASE_MONTH 7
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue