220 40524 <3a5821ae-c386-46b4-8e73-4bff8764679c@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Bengt Gustafsson <bengt.gustafsson@beamways.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Function to compute the absolute value of any
 integral value including signed minimums
Date: Sat, 13 Oct 2018 19:31:16 -0700 (PDT)
Lines: 56
Approved: news@gmane.org
Message-ID: <3a5821ae-c386-46b4-8e73-4bff8764679c@isocpp.org>
References: <3f8200be-918a-44a0-a412-6f8f43da1c51@isocpp.org>
 <CABPJVnS+UYT9Q-6X3Y_t043==ND38cyA5048c1HjbVkX8q3cEw@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1070_234037989.1539484276879"
X-Trace: blaine.gmane.org 1539484153 13207 195.159.176.226 (14 Oct 2018 02:29:13 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sun, 14 Oct 2018 02:29:13 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCRIRSPDTQIRB5OURLPAKGQEXQBQOBY@isocpp.org Sun Oct 14 04:29:09 2018
Return-path: <std-proposals+bncBCRIRSPDTQIRB5OURLPAKGQEXQBQOBY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yw1-f71.google.com ([209.85.161.71])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCRIRSPDTQIRB5OURLPAKGQEXQBQOBY@isocpp.org>)
	id 1gBW9V-0003KE-6z
	for gclcip-std-proposals@m.gmane.org; Sun, 14 Oct 2018 04:29:09 +0200
Original-Received: by mail-yw1-f71.google.com with SMTP id 135-v6sf10470340yww.14
        for <gclcip-std-proposals@m.gmane.org>; Sat, 13 Oct 2018 19:31:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:in-reply-to:references:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe;
        bh=aWK+9acN92jA8RIEU4Gr+n8h5MBmx6Ffl9v4CKTDjoc=;
        b=xpUOAXengKl0Nq4mCrhaUQO+Uva4wRHS1UVX/OX+HA/Te2NZTD13R8sPDhoEEoIJqJ
         OBdMw6r2MvokrATP2jHN0CK6RV1yGf/LE9LW/lUqUB/1wNG1EDvslYEXsdwJ2qBIL3wX
         Pmzej1LHNCatQbrN7E0WszAec1B373AYZ26NlkTliR/D74wUY3DtfQikx0efOdI1pvdf
         wD1pjrWqM6ofiREVvubgumYwoJLkgzJk2O08UrzkkjKcSIH3yoC9XNaaWSrY2f5D2m8O
         ZYFkA2mqHp6YAiOBAFbE2F0W8TWXNRbgUQnhM6oJeS46P8jFM0gURfo/dLS9YVTrbLHC
         aCjw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:message-id:in-reply-to:references
         :subject:mime-version:x-original-sender:reply-to:precedence
         :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=aWK+9acN92jA8RIEU4Gr+n8h5MBmx6Ffl9v4CKTDjoc=;
        b=DeXwqhd5JfsSLhGO7O4aWkVvTV+HhyTCD97s/QbPgEFN5xfbWiEkGcs1nU6XR20k98
         sTXwCISZ4cnCm7486lQmPAXCZbpo3aMeFx+BcC0IDauHF9NEc/HgiHAVoa3YRZd+0hQ1
         t83NrtW9gwEgxC6898eynEGzpmX9Hh9MZ9gXn1p0/PjcR4LuQrqvo+gnnw2tftf40jkf
         wxeotDtpmqFKtx8UPyhOphwNdariRREnQjv65g9ExwqU03qJMDs1Cguj44qSq6imwOhd
         5jCcaTQQKm8fT9yGeAqxyQHAlqkRaK9eOTq98CTVZlukCA7GZz4rfOJy22nrPsMgdxcD
         2phA==
X-Gm-Message-State: ABuFfojUM78hedjzsV5odilcNcs38aDx3JBz7Wh7fd6GOIYtvxXVMdOn
	C7OJOuAvokXzJpP5St1khdCz7g==
X-Google-Smtp-Source: ACcGV63+Ty457taqH2oxXnlyyzqHoxH26CnBNYYyufiRAt82PQdFVGjpEvnqwdKLw+SU0WokE98v1g==
X-Received: by 2002:a5b:490:: with SMTP id n16-v6mr6728965ybp.15.1539484279522;
        Sat, 13 Oct 2018 19:31:19 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a25:9b82:: with SMTP id v2-v6ls4834357ybo.6.gmail; Sat, 13
 Oct 2018 19:31:17 -0700 (PDT)
X-Received: by 2002:a25:b29c:: with SMTP id k28-v6mr138435ybj.3.1539484277589;
        Sat, 13 Oct 2018 19:31:17 -0700 (PDT)
In-Reply-To: <CABPJVnS+UYT9Q-6X3Y_t043==ND38cyA5048c1HjbVkX8q3cEw@mail.gmail.com>
X-Original-Sender: bengt.gustafsson@beamways.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:40524
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/40524>

------=_Part_1070_234037989.1539484276879
Content-Type: multipart/alternative; 
	boundary="----=_Part_1071_77927388.1539484276879"

------=_Part_1071_77927388.1539484276879
Content-Type: text/plain; charset="UTF-8"

For me the motivation for uabs() would more be to avoid unsigned/signed 
mismatch errors by getting the result as an unsigned (which we know it 
conceptually is after abs).

This is very similar to the annoyance of floor, round and ceil returning 
floats which we know have integer values, forcing us to write int(round(x)) 
when using this with other ints to avoid compiler warnings. I think I saw 
something about new floor<int>() and similar functions being proposed, so 
why not uabs?

-- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/3a5821ae-c386-46b4-8e73-4bff8764679c%40isocpp.org.

------=_Part_1071_77927388.1539484276879
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">For me the motivation for uabs() would more be to avoid un=
signed/signed mismatch errors by getting the result as an unsigned (which w=
e know it conceptually is after abs).<div><br></div><div>This is very simil=
ar to the annoyance of floor, round and ceil returning floats which we know=
 have integer values, forcing us to write int(round(x)) when using this wit=
h other ints to avoid compiler warnings. I think I saw something about new =
floor&lt;int&gt;() and similar functions being proposed, so why not uabs?</=
div><div><br></div></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/3a5821ae-c386-46b4-8e73-4bff8764679c%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/3a5821ae-c386-46b4-8e73-4bff8764679c=
%40isocpp.org</a>.<br />

------=_Part_1071_77927388.1539484276879--

------=_Part_1070_234037989.1539484276879--

.
