Re: [netmod] Question on YANG 'fraction-digit' statement

Martin Bjorklund <mbj@tail-f.com> Thu, 19 December 2019 11:21 UTC

Return-Path: <mbj@tail-f.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A2B961200B4 for <netmod@ietfa.amsl.com>; Thu, 19 Dec 2019 03:21:01 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Z47EUTWkpc3T for <netmod@ietfa.amsl.com>; Thu, 19 Dec 2019 03:21:00 -0800 (PST)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id 5C349120071 for <netmod@ietf.org>; Thu, 19 Dec 2019 03:21:00 -0800 (PST)
Received: from localhost (unknown [173.38.220.41]) by mail.tail-f.com (Postfix) with ESMTPSA id 4CD441AE0389; Thu, 19 Dec 2019 12:20:58 +0100 (CET)
Date: Thu, 19 Dec 2019 12:20:22 +0100 (CET)
Message-Id: <20191219.122022.2127262858367842315.mbj@tail-f.com>
To: william.ivory@intl.att.com
Cc: netmod@ietf.org
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <af85620369afc261221dae869f59052efcdeb290.camel@intl.att.com>
References: <af85620369afc261221dae869f59052efcdeb290.camel@intl.att.com>
X-Mailer: Mew version 6.8 on Emacs 25.2
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/_3mm9nGAzw09u-DBmIEmAUZ_2jM>
Subject: Re: [netmod] Question on YANG 'fraction-digit' statement
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 19 Dec 2019 11:21:01 -0000

Hi,

"Ivory, William" <william.ivory@intl.att.com> wrote:
> Hi,
> 
> I've got a question about the 'fraction-digit' statement which I'm
> hoping someone can clarify. I know it is used to specify the range of
> valid values, as shown (in part) in the table below:
> 
> 
>      +----------------+-----------------------+----------------------+
>      | fraction-digit | min                   | max                  |
>      +----------------+-----------------------+----------------------+
>      | 1              | -922337203685477580.8 | 922337203685477580.7 |
>      | 2              | -92233720368547758.08 | 92233720368547758.07 |
>      | 3              | -9223372036854775.808 | 9223372036854775.807 |
> 
> 
> 
> My question is whether it implicitly imposes any restriction on the
> number of digits that can follow the decimal point for a valid value,
> ie for 'fraction-digits 2', is 123.45678 valid, or only 123.45?

If fraction-digits is 2, it means, according to section 9.3 in RFC
7950, that the value space consists of the real numbers that are
expressible as "i x 10^-2", where "i" is a 64-bit integer.  123.45678
cannot be expressed in this way, which means that it is not a valid
value for this type.


/martin