From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.0 required=3.0 tests=AWL,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id D71CA1F770 for ; Wed, 2 Jan 2019 04:25:24 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 22C15121A81; Wed, 2 Jan 2019 13:25:23 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id 801DD121381 for ; Wed, 2 Jan 2019 13:25:20 +0900 (JST) Received: by filter0031p3las1.sendgrid.net with SMTP id filter0031p3las1-21027-5C2C3D2C-1A 2019-01-02 04:25:16.79267946 +0000 UTC m=+1059189.234531945 Received: from herokuapp.com (ec2-54-162-228-70.compute-1.amazonaws.com [54.162.228.70]) by ismtpd0015p1iad2.sendgrid.net (SG) with ESMTP id qVe9f2AERfi3np2y-bKhgw Wed, 02 Jan 2019 04:25:16.523 +0000 (UTC) Date: Wed, 02 Jan 2019 04:25:18 +0000 (UTC) From: muraken@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 66271 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15491 X-Redmine-Issue-Author: mrkn X-Redmine-Issue-Assignee: mrkn X-Redmine-Sender: mrkn X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS5AWbMWnAkHin+uQuKc/NhBiqIoYxwfQrTkqC rykh4gbNP6WFNdt2sKD68ZIML4Ufzj+DW/nu8BL0+zKGtZmOXYIHsqu77KD7Itzfr8aa0xNokE/s5z /M7Yqo7wcS45LUqtVJGntoQIfSx8iW53pAT/W4YL5yT+Yzw+utiFV7LZvQ== X-ML-Name: ruby-core X-Mail-Count: 90849 Subject: [ruby-core:90849] [Ruby trunk Bug#15491][Closed] r62701 introduced the incompatibility of Complex#+, #-, and #* removing #ifndef PRESERVE_SIGNEDZERO X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #15491 has been updated by mrkn (Kenta Murata). Status changed from Assigned to Closed Applied in changeset trunk|r66688. ---------- complex.c: fix against redefining component methods This fixes the incompatibility (maybe unintentionally) introduced by removal of `#ifndef PRESERVE_SIGNEDZERO` guards in f_add, f_mul, and f_sub functions in r62701. [Bug #15491] [ruby-core:90843] ---------------------------------------- Bug #15491: r62701 introduced the incompatibility of Complex#+, #-, and #* removing #ifndef PRESERVE_SIGNEDZERO https://bugs.ruby-lang.org/issues/15491#change-76036 * Author: mrkn (Kenta Murata) * Status: Closed * Priority: Normal * Assignee: mrkn (Kenta Murata) * Target version: * ruby -v: ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-linux] * Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- In r62701, preprocessor conditions `#ifndef PRESERVE_SIGNEDZERO` in `f_add`, `f_mul`, and `f_sub` functions were removed. These changes introduced the incompatibility for some special cases. For example, the results of the following code shows the different sign of the imaginary part: ``` p Complex(-0.0, 0) * Complex(0, 0) #=> (-0.0+0.0i) on 2.5.3 #=> (-0.0-0.0i) on 2.6.0 ``` Moreover, the following code shows the different values in the real part: ``` class Integer def +(*); 42; end end p Complex(1, 2) + Complex(0, 1) #=> (42+42i) on 2.5.3 #=> (0+42i) on 2.6.0 ``` -- https://bugs.ruby-lang.org/