[ruby-cvs:72742] shyouhei:r65642 (trunk): numeric.c: avoid division by zero

shyouhei at ruby-lang.org shyouhei at ruby-lang.org
Fri Nov 9 18:14:23 JST 2018


shyouhei	2018-11-09 18:14:23 +0900 (Fri, 09 Nov 2018)

  New Revision: 65642

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

  Log:
    numeric.c: avoid division by zero
    
    In C, division by zero is undefined, even if the expression is double
    (cf: ISO/IEC 9899:1990 section 6.3.5).  OTOH we have tests about such
    operations and results, means we expect no exceptional situation shall
    occur.  We need to carefully reroute the situation, and generate what
    is needed.
    
    See also: https://travis-ci.org/ruby/ruby/jobs/452680646#L2943
    
    PS: Recently (last two decades), C have Annex. F document. It
    normatively specifies that the division operator is IEEE 754's
    division operator (cf: ISO/IEC 9899:1999 section F.3).  If we could
    move to such newer version this could be no problem.  But that is not
    possible today.

  Modified files:
    trunk/numeric.c


More information about the ruby-cvs mailing list