Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1infm3-0007if-73 for pgsql-hackers@arkaria.postgresql.org; Sat, 04 Jan 2020 09:31:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1infm1-0003wy-10 for pgsql-hackers@arkaria.postgresql.org; Sat, 04 Jan 2020 09:31:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1infm0-0003wq-CP for pgsql-hackers@lists.postgresql.org; Sat, 04 Jan 2020 09:31:08 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1inflt-0006c6-GA for pgsql-hackers@lists.postgresql.org; Sat, 04 Jan 2020 09:31:06 +0000 Received: by mail-wr1-x434.google.com with SMTP id b6so44560372wrq.0 for ; Sat, 04 Jan 2020 01:31:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=EblGGtjLHTOGcBZa2Z48ipsfZwn3Zzp3an/c2bkDYgw=; b=LyAeewMu+BuXin7UkFIjp6V7Iym8J5SL9TzERdoQ71zfiKV0genVD5lNROFScMaNH+ oDkxKcpzyn8YhtPVu1U6spyjhsF81/TFnRNdRpPzbic2/jp3Tcss/4ouv02paPtabjq6 CO7uWOPwrH0CDBc3A/RcHDVR/GPjpYRdnUBaYd87MEFu6si1jCxoxaNkJZzBP2vmWXDI n4HBg6VOmsou/dk5qLqyuX+xJRXY2hVvVDUNfa+oXY7dM9BSNAfDAb9WxcmX0lIA9i5q 7razPwK0La6q+MegL5v7ZoVSC3X0HyvHceL3kEyQVqk7lirH8rw1rGQmoG9ec4Ip9J3Z /SsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=EblGGtjLHTOGcBZa2Z48ipsfZwn3Zzp3an/c2bkDYgw=; b=k2fyCC3UUMPn+fM2EPm/Po0i175WOzbPtKi3wuZUHDmxamgrr4lwYLFWCL6CYo7/qE kryw+/Ikvtf5RWvQGfgGCOn21H/FI5UjfGtwTcRYD9VgOXWDGoXhujES4EHhFJqROHqm 0F1BwtsctgBbKxXM4gvpNsVftPc4PLjTDOynu6qEzy9yCB+C5bioSsHA/Q4f/xllhLPa HKL5QpNAfVJKI+sOsBqkh3eNSD9gp9W+1Es94sXIFZwh57Z7d6lelPzdUZOUlhgm9EMW oOJz/604vOhoRMRqxuXzRPFhBDz2Gb4Quy9WhVqW25Ie1KVa0slsVJThk6AZqxQcxTuY 5AnQ== X-Gm-Message-State: APjAAAW+9pXJXUnBcDmhOMPDBWCTfZAsGpJbZjR5Q3BkiXqJStlNNnST QlYzDl23SR1bTy8Uix7mQl/fPOCKgmhZnla5HfbuJCAjassGzLUGkcImLUZC22KI6XQfNKRIEGm gy58lOIiVqS+9fJvrVyY/iZy2NgJCRPc+n5p3HlercZIDQ7MZ1Pu/peswzcwPXDeAFABXtTEbMh C0nKXE2Owj44YQwzVmFQ== X-Google-Smtp-Source: APXvYqyNaSrtV4HwOZq2RJZaz/jeo5F1Up1Yu1H3ZZHviDOD7F7fcfW0ezSgVAdrLo4FIrCMa9pAPA== X-Received: by 2002:a5d:5381:: with SMTP id d1mr33790544wrv.259.1578130259685; Sat, 04 Jan 2020 01:30:59 -0800 (PST) Received: from [10.8.8.7] ([185.94.189.189]) by smtp.gmail.com with ESMTPSA id e18sm64227303wrw.70.2020.01.04.01.30.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 04 Jan 2020 01:30:59 -0800 (PST) Subject: Re: Greatest Common Divisor To: Fabien COELHO Cc: Tom Lane , Stephen Frost , Dean Rasheed , Chapman Flack , PostgreSQL Hackers References: <5E08D947.9000902@anastigmatix.net> <20200102145712.GN3195@tamriel.snowman.net> <16242.1577977961@sss.pgh.pa.us> <6855727c-3836-21cc-18f9-e79227b99079@2ndquadrant.com> <5bf72c6b-1290-2ba0-770b-8a13e899fd98@2ndquadrant.com> From: Vik Fearing Message-ID: <4998d2c6-ba16-e6eb-df0c-e5fbf234d52d@2ndquadrant.com> Date: Sat, 4 Jan 2020 10:30:55 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 04/01/2020 09:35, Fabien COELHO wrote: >>> I'm unsure about gcd(INT_MIN, 0) should error. Possibly 0 would be >>> nicer? >> >> >> What justification for that do you have? > > ISTM that the current implementation has: > >   \forall int4 n, n \neq MIN_INT4, \gcd(n, 0) = 0 ? > > In which case applying the same rule for min int seems ok. No, gcd(n, 0) = n. -- Vik Fearing