Re: [netmod] float vs. decimal (fwd)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [netmod] float vs. decimal (fwd)
Between March 11 and June 9, there was a lengthy discussion on this
list that resulted in a proposal to add a derived type called 'real'
to draft-ietf-netmod-yang-types-04. The proposal was submitted in
its final form (below) before WGLC for draft-ietf-netmod-yang-types-03
ended on June 10.
The draft-ietf-netmod-yang-types-04 document is out now and I see that the
new derived type was not included. Juergen's alternative proposal to make
decimal64's fraction-digits substatement be optional (15-May) is not
reflected in draft-ietf-netmod-yang-08 either.
Was this omission done intentionally, and if so, why?
-David
typedef real {
type union {
type decimal64 {
fraction-digits 18;
range "-0.999999999999999999 .. 0.999999999999999999";
}
type decimal64 {
fraction-digits 17;
range "-9.99999999999999999 .. 9.99999999999999999";
}
type decimal64 {
fraction-digits 16;
range "-99.9999999999999999 .. 99.9999999999999999";
}
type decimal64 {
fraction-digits 15;
range "-999.999999999999999 .. 999.999999999999999";
}
type decimal64 {
fraction-digits 14;
range "-9999.99999999999999 .. 9999.99999999999999";
}
type decimal64 {
fraction-digits 13;
range "-99999.9999999999999 .. 99999.9999999999999";
}
type decimal64 {
fraction-digits 12;
range "-999999.999999999999 .. 999999.999999999999";
}
type decimal64 {
fraction-digits 11;
range "-9999999.99999999999 .. 9999999.99999999999";
}
type decimal64 {
fraction-digits 10;
range "-99999999.9999999999 .. 99999999.9999999999";
}
type decimal64 {
fraction-digits 9;
range "-999999999.999999999 .. 999999999.999999999";
}
type decimal64 {
fraction-digits 8;
range "-9999999999.99999999 .. 9999999999.99999999";
}
type decimal64 {
fraction-digits 7;
range "-99999999999.9999999 .. 99999999999.9999999";
}
type decimal64 {
fraction-digits 6;
range "-999999999999.999999 .. 999999999999.999999";
}
type decimal64 {
fraction-digits 5;
range "-9999999999999.99999 .. 9999999999999.99999";
}
type decimal64 {
fraction-digits 4;
range "-99999999999999.9999 .. 99999999999999.9999";
}
type decimal64 {
fraction-digits 3;
range "-999999999999999.999 .. 999999999999999.999";
}
type decimal64 {
fraction-digits 2;
range "-9999999999999999.99 .. 9999999999999999.99";
}
type decimal64 {
fraction-digits 1;
range "-99999999999999999.9 .. 99999999999999999.9";
}
type enumeration {
enum overflow;
enum underflow;
}
}
description
"The real type defines a large, finite set of real numbers with
varying degrees of magnitude and precision. An object of type
real is able to express configuration and state data as any of
the real numbers in the set. The real type is suitable for
applications that deal with ratios in which the decimal point is
not fixed to a single position.
Positive numbers larger than 99999999999999999.9 in state data
SHALL be represented as an overflow. The enumerated value
overflow is not valid for an <edit-config> operation.
Negative numbers larger than -99999999999999999.9 in state data
SHALL be represented as an underflow. The enumerated value
underflow is not valid for an <edit-config> operation.
Real numbers between -99999999999999999.9 and 99999999999999999.9
(inclusive) having a combination of magnitude and precision that
falls outside of one of the range substatements in the union--
including irrational numbers such as 'pi'--may only be
represented by the real type through rounding or truncation.
For example, pi could be rounded (up) to 3.14159265358979324 or
truncated to 3.14159265358979323 to preserve as much of the
precision information as possible. Note that an application
could choose to round (down) the value of pi to 3.14 or truncate
the value of pi to 3.14. This specification does not define
rules for the rounding or truncating of such values, considering
these decisions to be application-specific.";
}
On Wed, 27 May 2009, David Partain wrote:
> This is the working group last call on the current working group
> document:
>
> - Common YANG Data Types:
> http://tools.ietf.org/html/draft-ietf-netmod-yang-types-03.txt
>
> The editor and the chairs think that this document is mature enough for
> WGLC. This WGLC will last until June 10, 2009.
-------------------------------------------------------------
David Spakes email: spakes at snmp.com
SNMP Research voice: +1 865 573 1434
3001 Kimberlin Heights Road fax: +1 865 573 9197
Knoxville, TN 37920-9716 USA http://www.snmp.com
-------------------------------------------------------------
Note: Messages sent to this list are the opinions of the senders and do not imply endorsement by the IETF.