ruby-changes:46524
From: nobu <ko1@a...>
Date: Wed, 10 May 2017 09:20:09 +0900 (JST)
Subject: [ruby-changes:46524] nobu:r58645 (trunk): math.c (ruby_lgamma_r): reduce duplicate code
nobu 2017-05-10 09:20:02 +0900 (Wed, 10 May 2017) New Revision: 58645 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58645 Log: math.c (ruby_lgamma_r): reduce duplicate code Modified files: trunk/math.c Index: math.c =================================================================== --- math.c (revision 58644) +++ math.c (revision 58645) @@ -800,11 +800,8 @@ ruby_lgamma_r(const double d, int *sign) https://github.com/ruby/ruby/blob/trunk/math.c#L800 { const double g = lgamma_r(d, sign); if (isinf(g)) { - if (d == 0.0 && signbit(d)) { - *sign = -1; - return INFINITY; - } else if (d == 0.0 && !signbit(d)) { - *sign = 1; + if (d == 0.0) { + *sign = signbit(d) ? -1 : +1; return INFINITY; } } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/