mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	merge revision(s) 57686: [Backport #13233]
rational.c: fix rdoc * rational.c: [DOC] fix wrong indentations and comment out some lines in code examples to make them valid Ruby code and syntax highlighted on the rendered page. [ci skip] [ruby-core:79607] [Bug #13233] Author: Marcus Stollsteimer <sto.mar@web.de> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@61363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									fb5f4573c1
								
							
						
					
					
						commit
						364909534d
					
				
					 2 changed files with 16 additions and 17 deletions
				
			
		
							
								
								
									
										31
									
								
								rational.c
									
										
									
									
									
								
							
							
						
						
									
										31
									
								
								rational.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1257,8 +1257,8 @@ nurat_negative_p(VALUE self)
 | 
			
		|||
 *
 | 
			
		||||
 *  Returns the absolute value of +rat+.
 | 
			
		||||
 *
 | 
			
		||||
 *  (1/2r).abs    #=> 1/2r
 | 
			
		||||
 *  (-1/2r).abs   #=> 1/2r
 | 
			
		||||
 *     (1/2r).abs    #=> 1/2r
 | 
			
		||||
 *     (-1/2r).abs   #=> 1/2r
 | 
			
		||||
 *
 | 
			
		||||
 *  Rational#magnitude is an alias of Rational#abs.
 | 
			
		||||
 */
 | 
			
		||||
| 
						 | 
				
			
			@ -1294,8 +1294,7 @@ nurat_ceil(VALUE self)
 | 
			
		|||
 *
 | 
			
		||||
 * Returns the truncated value as an integer.
 | 
			
		||||
 *
 | 
			
		||||
 * Equivalent to
 | 
			
		||||
 *    rat.truncate.
 | 
			
		||||
 * Equivalent to Rational#truncate.
 | 
			
		||||
 *
 | 
			
		||||
 *    Rational(2, 3).to_i   #=> 0
 | 
			
		||||
 *    Rational(3).to_i      #=> 3
 | 
			
		||||
| 
						 | 
				
			
			@ -1435,9 +1434,9 @@ f_round_common(int argc, VALUE *argv, VALUE self, VALUE (*func)(VALUE))
 | 
			
		|||
 *    Rational(2, 3).floor   #=> 0
 | 
			
		||||
 *    Rational(-3, 2).floor  #=> -1
 | 
			
		||||
 *
 | 
			
		||||
 *           decimal      -  1  2  3 . 4  5  6
 | 
			
		||||
 *                          ^  ^  ^  ^   ^  ^
 | 
			
		||||
 *          precision      -3 -2 -1  0  +1 +2
 | 
			
		||||
 *      #    decimal      -  1  2  3 . 4  5  6
 | 
			
		||||
 *      #                   ^  ^  ^  ^   ^  ^
 | 
			
		||||
 *      #   precision      -3 -2 -1  0  +1 +2
 | 
			
		||||
 *
 | 
			
		||||
 *    '%f' % Rational('-123.456').floor(+1)  #=> "-123.500000"
 | 
			
		||||
 *    '%f' % Rational('-123.456').floor(-1)  #=> "-130.000000"
 | 
			
		||||
| 
						 | 
				
			
			@ -1459,9 +1458,9 @@ nurat_floor_n(int argc, VALUE *argv, VALUE self)
 | 
			
		|||
 *    Rational(2, 3).ceil   #=> 1
 | 
			
		||||
 *    Rational(-3, 2).ceil  #=> -1
 | 
			
		||||
 *
 | 
			
		||||
 *           decimal      -  1  2  3 . 4  5  6
 | 
			
		||||
 *                          ^  ^  ^  ^   ^  ^
 | 
			
		||||
 *          precision      -3 -2 -1  0  +1 +2
 | 
			
		||||
 *      #    decimal      -  1  2  3 . 4  5  6
 | 
			
		||||
 *      #                   ^  ^  ^  ^   ^  ^
 | 
			
		||||
 *      #   precision      -3 -2 -1  0  +1 +2
 | 
			
		||||
 *
 | 
			
		||||
 *    '%f' % Rational('-123.456').ceil(+1)  #=> "-123.400000"
 | 
			
		||||
 *    '%f' % Rational('-123.456').ceil(-1)  #=> "-120.000000"
 | 
			
		||||
| 
						 | 
				
			
			@ -1483,9 +1482,9 @@ nurat_ceil_n(int argc, VALUE *argv, VALUE self)
 | 
			
		|||
 *    Rational(2, 3).truncate   #=> 0
 | 
			
		||||
 *    Rational(-3, 2).truncate  #=> -1
 | 
			
		||||
 *
 | 
			
		||||
 *           decimal      -  1  2  3 . 4  5  6
 | 
			
		||||
 *                          ^  ^  ^  ^   ^  ^
 | 
			
		||||
 *          precision      -3 -2 -1  0  +1 +2
 | 
			
		||||
 *      #    decimal      -  1  2  3 . 4  5  6
 | 
			
		||||
 *      #                   ^  ^  ^  ^   ^  ^
 | 
			
		||||
 *      #   precision      -3 -2 -1  0  +1 +2
 | 
			
		||||
 *
 | 
			
		||||
 *    '%f' % Rational('-123.456').truncate(+1)  #=>  "-123.400000"
 | 
			
		||||
 *    '%f' % Rational('-123.456').truncate(-1)  #=>  "-120.000000"
 | 
			
		||||
| 
						 | 
				
			
			@ -1508,9 +1507,9 @@ nurat_truncate_n(int argc, VALUE *argv, VALUE self)
 | 
			
		|||
 *    Rational(2, 3).round   #=> 1
 | 
			
		||||
 *    Rational(-3, 2).round  #=> -2
 | 
			
		||||
 *
 | 
			
		||||
 *           decimal      -  1  2  3 . 4  5  6
 | 
			
		||||
 *                          ^  ^  ^  ^   ^  ^
 | 
			
		||||
 *          precision      -3 -2 -1  0  +1 +2
 | 
			
		||||
 *      #    decimal      -  1  2  3 . 4  5  6
 | 
			
		||||
 *      #                   ^  ^  ^  ^   ^  ^
 | 
			
		||||
 *      #   precision      -3 -2 -1  0  +1 +2
 | 
			
		||||
 *
 | 
			
		||||
 *    '%f' % Rational('-123.456').round(+1)  #=> "-123.500000"
 | 
			
		||||
 *    '%f' % Rational('-123.456').round(-1)  #=> "-120.000000"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
#define RUBY_VERSION "2.4.4"
 | 
			
		||||
#define RUBY_RELEASE_DATE "2017-12-20"
 | 
			
		||||
#define RUBY_PATCHLEVEL 210
 | 
			
		||||
#define RUBY_PATCHLEVEL 211
 | 
			
		||||
 | 
			
		||||
#define RUBY_RELEASE_YEAR 2017
 | 
			
		||||
#define RUBY_RELEASE_MONTH 12
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue