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 1gUIbU-0006LU-EV for pgsql-general@arkaria.postgresql.org; Tue, 04 Dec 2018 21:51:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gUIbS-0002bj-NY for pgsql-general@arkaria.postgresql.org; Tue, 04 Dec 2018 21:51:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gUIbS-0002bc-Cv for pgsql-general@lists.postgresql.org; Tue, 04 Dec 2018 21:51:38 +0000 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gUIbP-0004Y9-Ay for pgsql-general@lists.postgresql.org; Tue, 04 Dec 2018 21:51:37 +0000 Received: by mail-pf1-x42b.google.com with SMTP id z9so8891798pfi.2 for ; Tue, 04 Dec 2018 13:51:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=bSpuUpFIUHEm8f8u28mZeZnjeyF8cW4gzrxoTkVbrnQ=; b=fzv+49VngzrT6PepbS8WjYCEVraxxXHACjnLX/hCjO3q+h03abwZXmQGCMbFM0qafL NcLXlOGc5H5Qh9xsggoATvk7yRam9wJ7P4aNIRVB1pbFVrzYowU10E5KgsZPhxXoeeVO SlBMbKzAnjqSPYK1/iMwYbZ/Y1YumSaI6WmsSfxC2N2Lx6mhINVNCU+f1pqQu9YRaWiq EZKhP8C/1aEc8jxPUpuCtzTc18J3Tq2D+D5NGan6tUi/8pySOYSiAz3gXXLF4C6wuxqd eT+nN3NotI/2I9qTbabULukfJTDZP8LMIb8VvFXAeWFCEOScxHu7jLWQH5NKTAU/3g4q r73Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=bSpuUpFIUHEm8f8u28mZeZnjeyF8cW4gzrxoTkVbrnQ=; b=O5MmGx7eco16j1bpFhcSNnTS/YjHcSRU1wzG5ycaSc+uuT6OS6AgghD8IUOU2VKFdt pSze24H0BxqtsDm8ov2MVJXV/VtBr98PuQspv9+hhuPVwkD8FPgm54MdqtXwbIx+hDHy BF2wFlaQ+i1W9JKgpPq+gyqQwNQgMJA8Dwg4uGgJDXLuXeLwDOqVjQYC+nGXCiaxp1tB M/lo9UHdv6U+21PaNLHXrMqVl4K7Bo+4NjA99MUVvJwHIB9ptWpu69y5xW0fVJhzrD0L xbM7ipraxDo/DNZtxqH8saQqmaPSAtAk7w3+muHyfK5GlMa26w+vb33Njo67g/RjO7Z+ /Vzw== X-Gm-Message-State: AA+aEWakISwIY21ySyKVcSmtYB0KT2YnM4PLUuyEl3pmukl1ryI3ORkX QofFp00BKzTSy/30ERt24Typ2yMp X-Google-Smtp-Source: AFSGD/Vdh4Ni550yCyAjV9L1E4aHz84Zwl0FHi1KWg7ww/+yT5w6sLygeFILUYayjvn5oU+F4GZEEw== X-Received: by 2002:a62:7687:: with SMTP id r129mr21558100pfc.17.1543960292762; Tue, 04 Dec 2018 13:51:32 -0800 (PST) Received: from [10.104.134.14] ([155.100.47.6]) by smtp.gmail.com with ESMTPSA id s2sm29844160pfa.167.2018.12.04.13.51.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Dec 2018 13:51:32 -0800 (PST) Subject: Re: simple division To: pgsql-general@lists.postgresql.org References: <4DEACFC2-E8E3-4C61-805B-56A5F76CB819@northwestern.edu> <8B35EF9C-8DEF-4298-A646-89D1AC8F63E1@northwestern.edu> <1F5FCEFC-7DEA-46FA-9895-FBF7DFDEC750@northwestern.edu> From: Rob Sargent Message-ID: <627868ba-0d4b-8995-d29a-db6b7ca3673d@gmail.com> Date: Tue, 4 Dec 2018 14:51:31 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <1F5FCEFC-7DEA-46FA-9895-FBF7DFDEC750@northwestern.edu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 12/4/18 2:36 PM, Martin Mueller wrote: > It worked, and I must have done something wrong. I'm probably not the only person who would find something like the following helpful: > > > division (integer division truncates the result) 10/3 3 The math types might take offense here, with the use of "truncates".  Integer division really ask how many times can one subtract the numerator from the denominator without going negative (or how many times does the numerator "go into" the denominator). It may seem a nuisance, but int division is a useful construct and must be supported (and be the default). (If you have 10 people to transport in cars which hold four (all can drive) 10/4 = 3 ;) )