From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id C376A48B30 for ; Wed, 3 Jan 2024 16:17:19 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E997A68CC2B; Wed, 3 Jan 2024 18:17:16 +0200 (EET) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A6CA668B4D7 for ; Wed, 3 Jan 2024 18:17:10 +0200 (EET) Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-40d4a7f0c4dso99328005e9.1 for ; Wed, 03 Jan 2024 08:17:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704298629; x=1704903429; darn=ffmpeg.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:to:from:date:from:to:cc:subject :date:message-id:reply-to; bh=wuJiLsSMQlIj5/Vtf37YZ4x02SecdDi1cupW3klL5uk=; b=F3SR6IVgk7iXU7so7TBZe8/uMghDeJDly9/eDhR3RDs+puuJ2m0hyr2UM9mfv0WwxP qAHhy7cmWSGndOf2tnAh1AuXbIJThmV99lSWq3LtKWxi60mFw2Thxb3eKPun/uLGdGe7 zad89MRafPIwdKPpAW9FMSYDw+924bksHyymvgim5CDyiPUz2vdiM0VADtXT277SA6Dg IT/dXVtR3XiP1BNoxO4tzgCccFD5yHyYMADxZFPwtNwgNlLwCvCyJZXyzLtoneymZcRF gTqx5z1xOjZ5OgIjv98e1rblgkCf19YxEFldRQDaYSKgk/xYbLG9y5g3nC7Mq86P+giA 3AOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704298629; x=1704903429; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=wuJiLsSMQlIj5/Vtf37YZ4x02SecdDi1cupW3klL5uk=; b=F5ibv+XmriiWwqgQLC+eB4ev9r0LxaOuixaZ5jEOiMGJAXilWC+sZSED0X7DSdmf1G MkZqfP9UBkVobpmWM9a9HLLsd2+38kCharfgUxcaKKR3AaGe9FpL54NRtdmY3nIq3mOz RjJS4T/gpR/OrYN7dnpM0xmh4jbHA4X5PGu6GGYAxx+wnpGPuGyhUhCTamAuA+sqq5S9 zrREUe+gazkRhlpxIUq40PUEXVHour5gzGLyPmAZ0+97maQ4ZMwy8ApALE7CryswARAO aVFSj5/pc/7ZKN+OJwSpDcR9rwdn6e0++SorKtwVAa19Ia2rE35vNbyUBVWOGjE5x8QK fOig== X-Gm-Message-State: AOJu0Yxu4thjc/NV7HRwEfos/qMEO0JYVXuMe699fTtwGjOqoWLqkspa jZMWGcUqKkW9qQ+2pcGFPWsHF+SokEA= X-Google-Smtp-Source: AGHT+IEh6hjpe0Agz1Wj5nNfMVTblGR5nfIah3jLCw/b6YmX8/SQVtC+YQwXiewBFGRfJtrn7ZIiwQ== X-Received: by 2002:a05:600c:b4d:b0:40d:3c6e:6645 with SMTP id k13-20020a05600c0b4d00b0040d3c6e6645mr9833656wmr.188.1704298628984; Wed, 03 Jan 2024 08:17:08 -0800 (PST) Received: from mariano (dynamic-adsl-84-220-189-10.clienti.tiscali.it. [84.220.189.10]) by smtp.gmail.com with ESMTPSA id l2-20020a05600c4f0200b0040d5ae2906esm2758023wmq.30.2024.01.03.08.17.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jan 2024 08:17:08 -0800 (PST) Received: by mariano (Postfix, from userid 1000) id 6761ABFCDC; Wed, 3 Jan 2024 17:17:07 +0100 (CET) Date: Wed, 3 Jan 2024 17:17:07 +0100 From: Stefano Sabatini To: FFmpeg development discussions and patches Message-ID: Mail-Followup-To: FFmpeg development discussions and patches References: <20240101193859.1038078-1-stefasab@gmail.com> <20240102001028.GW6420@pb2> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Rgt9ebhTwJHHj0iH" Content-Disposition: inline In-Reply-To: <20240102001028.GW6420@pb2> User-Agent: Mutt/2.1.4 (2021-12-11) Subject: Re: [FFmpeg-devel] [PATCH 1/2] libavutil/eval: introduce UINT64_MAX constant X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --Rgt9ebhTwJHHj0iH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On date Tuesday 2024-01-02 01:10:28 +0100, Michael Niedermayer wrote: > On Mon, Jan 01, 2024 at 08:38:58PM +0100, Stefano Sabatini wrote: > > This might be useful, e.g. when setting the random seed expressed as a > > uint64_t. > > --- > > doc/utils.texi | 3 +++ > > libavutil/eval.c | 1 + > > 2 files changed, 4 insertions(+) > > > > diff --git a/doc/utils.texi b/doc/utils.texi > > index 0c4f146f4f..ac9b63826e 100644 > > --- a/doc/utils.texi > > +++ b/doc/utils.texi > > @@ -1030,6 +1030,9 @@ area of the unit disc, approximately 3.14 > > exp(1) (Euler's number), approximately 2.718 > > @item PHI > > golden ratio (1+sqrt(5))/2, approximately 1.618 > > +@item UINT64_MAX > > +maximum value expressed as an unsigned integer, corresponds to > > > +18446744073709551616 ((2^64)-1) > > this doesnt look right > 2^x is even > even -1 is odd > 18446744073709551616 should be a odd number > 18446744073709551615 looks more likely > > double precission also doesnt like exactly ((2^64)-1) because the mantisse has too few bits > > (U)INT64_MIN should work though exactly in double Updated. --Rgt9ebhTwJHHj0iH Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-libavutil-eval-introduce-UINT64_MAX-constant.patch" >From f2772a82779b16982e3bc74176c6ff1011156096 Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Mon, 1 Jan 2024 20:32:38 +0100 Subject: [PATCH 1/2] libavutil/eval: introduce UINT64_MAX constant This might be useful, e.g. when setting the random seed expressed as a uint64_t value. --- doc/utils.texi | 3 +++ libavutil/eval.c | 1 + 2 files changed, 4 insertions(+) diff --git a/doc/utils.texi b/doc/utils.texi index 0c4f146f4f..dec009a015 100644 --- a/doc/utils.texi +++ b/doc/utils.texi @@ -1030,6 +1030,9 @@ area of the unit disc, approximately 3.14 exp(1) (Euler's number), approximately 2.718 @item PHI golden ratio (1+sqrt(5))/2, approximately 1.618 +@item UINT64_MAX +maximum value expressed as an unsigned 64-bits integer, corresponds to +18446744073709551615 ((2^64)-1) @end table Assuming that an expression is considered "true" if it has a non-zero diff --git a/libavutil/eval.c b/libavutil/eval.c index dc6b3697bc..93048bff91 100644 --- a/libavutil/eval.c +++ b/libavutil/eval.c @@ -100,6 +100,7 @@ static const struct { { "PI", M_PI }, { "PHI", M_PHI }, { "QP2LAMBDA", FF_QP2LAMBDA }, + { "UINT64_MAX", UINT64_MAX } }; double av_strtod(const char *numstr, char **tail) -- 2.34.1 --Rgt9ebhTwJHHj0iH Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". --Rgt9ebhTwJHHj0iH--