aboutsummaryrefslogtreecommitdiffstats
path: root/numeric.c
Commit message (Collapse)AuthorAgeFilesLines
* [DOC] Fix documentation of Numeric#div: Complex does not have #divKouhei Yanagita2022-06-031-1/+1
|
* [DIC] Fix typo in documentationKouhei Yanagita2022-05-271-3/+3
|
* Use correct capitalization of "NaN" in docsGrant Hutchins2022-04-131-1/+1
|
* [DOC] Use simple references to operator methodsNobuyoshi Nakada2022-03-261-16/+16
| | | | | | | Method references is not only able to be marked up as code, also reflects `--show-hash` option. The bug that prevented the old rdoc from correctly parsing these methods was fixed last month.
* [DOC] Fix formatting for What's Here in IO (#5719)Burdette Lamar2022-03-251-133/+133
| | | | | | | * Fix formatting for What's Here in IO * Repair formatting in What's Heres in numeric.c * Fix formatting for What's Here in IO
* [DOC] Fix a typo in `Integer#chr` exampleKoichi ITO2022-02-131-1/+1
| | | | | | | | | | | | | | The current example raises the following error. ```ruby 0..chr # => undefined local variable or method `chr' for main:Object (NameError) ``` This PR updates the example to produce the expected behavior. ```ruby 0.chr # => "\x00" ```
* [DOC] Simplify operator method referencesNobuyoshi Nakada2022-02-121-28/+26
|
* [DOC] Fix broken links to literals.rdocNobuyoshi Nakada2022-02-081-2/+2
|
* [DOC] Simplify links to global methodsNobuyoshi Nakada2022-02-081-2/+2
|
* [DOC] Use RDoc link style for links in the same class/modulePeter Zhu2022-02-071-11/+11
| | | | | | | | | | I used this regex: (?<=\[)#(?:class|module)-([A-Za-z]+)-label-([A-Za-z0-9\-\+]+) And performed a global find & replace for this: rdoc-ref:$1@$2
* [DOC] Use RDoc link style for links to other classes/modulesPeter Zhu2022-02-071-4/+4
| | | | | | | | | | I used this regex: ([A-Za-z]+)\.html#(?:class|module)-[A-Za-z]+-label-([A-Za-z0-9\-\+]+) And performed a global find & replace for this: rdoc-ref:$1@$2
* Shifting zero always results in zero [Bug #18517]Nobuyoshi Nakada2022-01-271-0/+2
|
* Negative RBOOL usageNobuyoshi Nakada2022-01-011-1/+1
|
* Make the internal predict `int_zero_p` return a boolNobuyoshi Nakada2022-01-011-6/+6
|
* Remove obsolete Fixnum and BignumNobuyoshi Nakada2021-12-281-4/+0
|
* [DOC] Integer.try_convert [ci skip]Nobuyoshi Nakada2021-12-081-0/+1
|
* Adding links to literals and Kernel (#5192)Burdette Lamar2021-12-031-3/+9
| | | | * Adding links to literals and Kernel
* Don't call + and < in Integer.times for !FIXNUMJeremy Evans2021-12-011-2/+2
| | | | | | | The methods aren't called for FIXNUM, and it's best to have consistent behavior. Fixes [Bug #18377]
* Enhanced RDoc for numeric.c (#5184)Burdette Lamar2021-11-271-2/+12
| | | Adds remarks about literals and Kernel methods to Float and Integer.
* Correct indentation error in numeric.c (#5178)Burdette Lamar2021-11-251-4/+4
|
* Whats here for float (#5170)Burdette Lamar2021-11-241-0/+57
| | | * What's Here for Float
* Enhanced RDoc for Float#floor (#5167)Burdette Lamar2021-11-241-138/+146
| | | | | | | * Enhanced RDoc for Float#floor * Enhanced RDoc for Float * Enhanced RDoc for Float
* Enhanced RDoc for Float#prev_float (#5162)Burdette Lamar2021-11-241-57/+34
| | | * Enhanced RDoc for Float#prev_float
* Enhanced RDoc for Float#next_float (#5160)Burdette Lamar2021-11-231-46/+54
| | | | * Enhanced RDoc for Float#next_float
* What's Here section for Integer (#5155)Burdette Lamar2021-11-221-4/+83
| | | * What's Here section for Integer
* Enhanced RDoc for Float (#5153)Burdette Lamar2021-11-221-42/+90
| | | | | | | | | | | | | Treats: #> #>= #< #<= #eql? #nan? #infinite? #finite?
* Enhanced RDoc for Float (#5150)Burdette Lamar2021-11-201-25/+57
| | | | | | | | | | | | | Treated (or previously treated): #quo #% #divmod #**` #eql? #<=> #== #hash
* Enhanced RDoc for Float (#5144)Burdette Lamar2021-11-191-19/+57
| | | | | | | | | | | Treats: #to_s #coerce #+ #- #* #/
* Optimize dynamic string interpolation for symbol/true/false/nil/0-9Jeremy Evans2021-11-181-3/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This provides a significant speedup for symbol, true, false, nil, and 0-9, class/module, and a small speedup in most other cases. Speedups (using included benchmarks): :symbol :: 60% 0-9 :: 50% Class/Module :: 50% nil/true/false :: 20% integer :: 10% [] :: 10% "" :: 3% One reason this approach is faster is it reduces the number of VM instructions for each interpolated value. Initial idea, approach, and benchmarks from Eric Wong. I applied the same approach against the master branch, updating it to handle the significant internal changes since this was first proposed 4 years ago (such as CALL_INFO/CALL_CACHE -> CALL_DATA). I also expanded it to optimize true/false/nil/0-9/class/module, and added handling of missing methods, refined methods, and RUBY_DEBUG. This renames the tostring insn to anytostring, and adds an objtostring insn that implements the optimization. This requires making a few functions non-static, and adding some non-static functions. This disables 4 YJIT tests. Those tests should be reenabled after YJIT optimizes the new objtostring insn. Implements [Feature #13715] Co-authored-by: Eric Wong <e@80x24.org> Co-authored-by: Alan Wu <XrXr@users.noreply.github.com> Co-authored-by: Yusuke Endoh <mame@ruby-lang.org> Co-authored-by: Koichi Sasada <ko1@atdot.net>
* Enhanced RDoc for Integer (#5139)Burdette Lamar2021-11-181-23/+62
| | | | | | | | Treats: #<< #>> #to_s
* Enhanced RDoc for Integer (#5138)Burdette Lamar2021-11-171-81/+119
| | | | | | | | | | | Treats: #times #round #floor #ceil #truncate ::sqrt
* Enhanced RDoc for Integer (#5134)Burdette Lamar2021-11-171-85/+156
| | | | | | | | | | | | | | Treated: #== #<=> #< #<= #> #>= #& #| #^
* Enhanced RDoc for Integer (#5120)Burdette Lamar2021-11-161-120/+149
| | | | | | | | | | | | | | | | Treated: #+ #- #* #fdiv #/ #div #** #[] #digits #upto #downto
* Enhanced RDoc for Integer (#5118)Burdette Lamar2021-11-151-69/+139
| | | | | | | | | | | | | | Treats: #allbits? #anybits? #nobits? #succ #pred #chr` #to_s #+ #-
* Revert "Enhanced RDoc for Integer (#5099)"Yusuke Endoh2021-11-151-138/+69
| | | | | | | | | | | | This reverts commit fc456adc6a62d09b755243b8c8f190934b9965d6. It broke the CI check. https://github.com/ruby/ruby/runs/4207922247?check_suite_focus=true#step:3:4 ``` numeric.c:3518: * 255.chr(Encoding::UTF_8) # => "ΓΏ" Error: Process completed with exit code 1. ```
* Enhanced RDoc for Integer (#5099)Burdette Lamar2021-11-131-69/+138
| | | | | | | | | | | | | | Treats: #allbits? #anybits? #nobits? #succ #pred #chr` #to_s #+ #-
* Get rid of implicit expansion to `long double` on ix86Nobuyoshi Nakada2021-11-081-5/+7
|
* Enhanced RDoc for Numeric (#4994)Burdette Lamar2021-10-281-68/+120
| | | | | | | | | | | | Treats: #eql? #<+> #floor #ceil #round #truncate #step
* Embed bare `double` if `sizeof(double) == sizeof(VALUE)`Nobuyoshi Nakada2021-10-271-1/+1
|
* Align `RFloat` at VALUE boundaryNobuyoshi Nakada2021-10-271-2/+6
|
* Fix unaligned access to `double` in RFloatNobuyoshi Nakada2021-10-261-0/+4
|
* Enhanced RDoc for Numeric (#4991)Burdette Lamar2021-10-191-33/+59
| | | | | | | | | | | | | | Treated: #@- #fdiv #div #abs #zero? #nonzero? #to_int #positive? #negative?
* Enhanced RDoc for numerics (#4982)Burdette Lamar2021-10-181-27/+63
| | | | | | | | | | | Treats: Numeric#coerce Numeric#clone Numeric#dup Numeric#@+ (unary plus) Numeric#i Float#coerce
* Enhanced RDoc for remainder (#4975)Burdette Lamar2021-10-151-12/+40
| | | Treats Numeric#remainder and Integer#remainder.
* Enhanced RDoc for divmod (#4973)Burdette Lamar2021-10-151-50/+69
| | | | | | | | Treats: Integer#divmod Float#divmod Numeric#divmod
* Enhanced RDoc for numeric.c (#4964)Burdette Lamar2021-10-151-16/+55
| | | Treats Integer#% and Float#%.
* Enhanced RDoc for Numeric#% (#4954)Burdette Lamar2021-10-121-4/+28
|
* Add flo_ndigits functionS-H-GAMELINKS2021-10-101-9/+11
|
* Refactor and Using RBOOL macroS.H2021-09-151-26/+13
|
* Using RB_FLOAT_TYPE_P macroS-H-GAMELINKS2021-09-121-40/+40
|