[ruby-cvs:72290] nobu:r65190 (trunk): complex.c: small optimization of Complex#**

nobu at ruby-lang.org nobu at ruby-lang.org
Sat Oct 20 11:49:18 JST 2018


nobu	2018-10-20 11:49:18 +0900 (Sat, 20 Oct 2018)

  New Revision: 65190

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65190

  Log:
    complex.c: small optimization of Complex#**
    
    * complex.c (rb_complex_pow): calculate power of a Fixnum without
      allocating intermediate Complex objects, and avoid unexpected
      NaNs.

  Modified files:
    trunk/complex.c
    trunk/internal.h
    trunk/numeric.c
    trunk/rational.c
    trunk/test/ruby/test_complex.rb


More information about the ruby-cvs mailing list