Sujet : Re: Real Number --- Merely numbers whose digits can be infinitely long
De : ben.usenet (at) *nospam* bsb.me.uk (Ben Bacarisse)
Groupes : comp.theoryDate : 29. Apr 2024, 12:57:55
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <87edaobfm4.fsf@bsb.me.uk>
References : 1
User-Agent : Gnus/5.13 (Gnus v5.13)
wij <
wyniijj5@gmail.com> writes:
The purpose this text is for establishing the bases for computational algorithm.
This file https://sourceforge.net/projects/cscall/files/MisFiles/RealNumber-en.txt/download
may be updated anytime.
>
+-------------+
| Real Number | ('computational' may be added to modify terms used in this file
+-------------+ if needed)
>
n-ary Fixed-Point Number::= Number represented by a string of digits, the
string may contain a minus sign or a point:
>
<fixed_point_number>::= [-] <wnum> [ . <frac> ]
<wnum>::= 0 | <nzd> { 0, <nzd> }
Some readers will be confused by this. When {}s are used for "zero or
more repetitions" what goes inside is the same kind of thing that goes
on the RHS of ::= and there (in production rules) you use | for
alternation. Hence
<wnum> ::= 0 | { 0 | <nzd> }
would be clearer. Of course, if you want "," to denote alternation, you
could write
<wnum> ::= 0, { 0, <nzd> }
instead. It's the mixing up of the notation that's pointless and
potentially confusing.
<frac>::= { 0, <nzd> } <nzd>
<nzd> ::= (1, 2, 3, 4, 5, 6, 7, 8, 9) // 'digit' varys depending on n-ary
Since you already have a notation for alternatives, it would be clearer
to write
<nzd> ::= 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
otherwise, you need to say what that the brackets with commas mean.
Ex: 78, -12.345, 3.1414159...(π)
The third example does not match the grammar. Also, I would guess you
intended to use the digits of pi.
Addition/subtraction of n-ary fixed-point numbers are the same as what is
taught in elementary schools (or on abacus). Any two n-ary fixed-point
number (same n-ary) a,b are equal iff their <fixed_point_number>
representation are identical. Otherwise, a>b or a<b, exactly one of these
two holds (Law of trichotomy).
So which of -0>0 and -0<0 holds? I'll take what you write about limits
with a pinch of salt until the basics are clear.
-- Ben.