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 1itcAZ-0001Ih-3p for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Jan 2020 18:53:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1itcAX-0001Jm-Si for pgsql-hackers@arkaria.postgresql.org; Mon, 20 Jan 2020 18:53:01 +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 1itcAX-0001Jf-Gn for pgsql-hackers@lists.postgresql.org; Mon, 20 Jan 2020 18:53:01 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1itcAT-0003kS-3N for pgsql-hackers@lists.postgresql.org; Mon, 20 Jan 2020 18:53:00 +0000 Received: by mail-wr1-x42f.google.com with SMTP id q6so538890wro.9 for ; Mon, 20 Jan 2020 10:52:56 -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=BeVZXmwrHXabfKKOHr65qUNJw17qDFZhcP2JKFKd8AY=; b=gGKQz4LnNHpo7NFwUuszqGnvpOjvj/q2v415Yj3U3nuL2uCEbxJ77zn3ulevy/ozor jNgii0enADCB1xWwZIOhdlLrYvN/adhU/X5X8ysGcWAyvjPYVXP1Kvk4/LuMCZvANoOu U5lWcOVzsmzg3jyeoBfIbJXi52nzMrryxFgoWvBbPG02fkhBTw4I7sA8lJrUzH1kiPqe n+87JmTDAMsrIB3+oIQX+lvz/nLKdVfSYgEIOhxvwxGyum/KaPo1uwGC4020fArq9kq6 nTEs4S1GnBVJDoyA7iN2RIaRu4MaMw7p76f5tZDIlakUkrQoZpBMOCjzPXNdm1lVKI8z 7OFw== 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=BeVZXmwrHXabfKKOHr65qUNJw17qDFZhcP2JKFKd8AY=; b=CX7GSdzWR8LFfI3w22sE/EEyaAoKyOAD5A+1IjiZ3ewT07PBX49onJykpaSeDnM8mx o4d6Ww12FuFAiyGWm5A//V2AJASjvcJt0L3CGHyRtRUuaAYkgpawiQDYapPr4LiRP+0o 3FlPMbCy3fn+HNNcozQHiLzmxq6fJb03uRBhHSjcFg3BG4JPb68lMzcbc4IiuZS8FJ1g 3hV8TdFMuUqLie+IAQVPBIbTUF7rp7ri4te4D6GeCP1D5S90b2ypgrN3hJvkRTSsLyuN V8H6IWqkT1jPg708jp9p2t8O2ueh4kj2JkqgAKQnY2RZsanV5MKXNipUnG6OuVN6MV2O BDMQ== X-Gm-Message-State: APjAAAXpWcsOZEYpjgipuC+L4gpwovNEoLUgZRiex+wQ1FMCE2xsxYBd rNOORSaoC7BZR5f4aoQci1u/hFDOUoD7eO0XdY8ueKwCYCCMDJH2uxjQkSneACFc9LOm6OwMEHx IK/kwyPjMizF5+LMe+g1mr/3ElHScqLjjs4yQJ2Rn4AczYSdOdbrzmJc1yoitid4pYuuXfh4Gh3 csVxJ7VuFyK+xvTkkzOg== X-Google-Smtp-Source: APXvYqysfWl35/gnQZ0v62x0IVFMtmJQVY8SFns+VIwQqsaUzSvNug/D1xmi2S9x8wajB5OoGJXQtQ== X-Received: by 2002:a5d:42c5:: with SMTP id t5mr917164wrr.73.1579546375019; Mon, 20 Jan 2020 10:52:55 -0800 (PST) Received: from [10.8.8.7] ([185.94.189.190]) by smtp.gmail.com with ESMTPSA id q11sm49201436wrp.24.2020.01.20.10.52.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Jan 2020 10:52:54 -0800 (PST) Subject: Re: Greatest Common Divisor To: Dean Rasheed Cc: Tom Lane , Fabien COELHO , Stephen Frost , 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> <32b8af34-8f87-c30f-5555-2325bd140a59@2ndquadrant.com> <13b5bbd5-6784-528f-9fd7-9fa43250be51@2ndquadrant.com> <535e8b2f-325b-788a-9dd9-58b170f45f98@2ndquadrant.com> <4307.1578400213@sss.pgh.pa.us> From: Vik Fearing Message-ID: <4c2a91c8-62e4-af28-5ea7-caf7726d9793@2ndquadrant.com> Date: Mon, 20 Jan 2020 19:52:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 20/01/2020 11:28, Dean Rasheed wrote: > Looking at the docs, I think it's worth going a little further than > just saying what the acronyms stand for -- especially since the > behaviour for zero inputs is an implementation choice (albeit the most > common one). I propose the following: > > + > + greatest common divisor — the largest positive number that > + divides both inputs with no remainder; returns 0 if > + both inputs are zero > + > > and: > > + > + least common multiple — the smallest strictly positive number > + that is an integer multiple of both inputs; returns > 0 > + if either input is zero > + > > (I have tried to be precise in my use of terms like "number" and > "integer", to cover the different cases) In that case should lcm be "...that is an integral multiple..." since the numeric version will return numeric? Other than that, I'm happy with this change. -- Vik Fearing