On 12/27/06, Conrad Sigona <[EMAIL PROTECTED]> wrote:
> I have some questions about the REAL type and constrained REAL types.
> References to
> the standard are to X.680 (07/2002):
>
> 1) According to 20.5 NOTE 1 the values
>
> R ::= REAL
>
> a R ::= {mantissa 1, base 2, exponent 0}
> b R ::= {mantissa 1, base 10, exponent 0}
>
> are different abstract values even if they both represent the
> mathematical real 1.

That's right.

> What about two forms expressed in the same base? Is
>
> c R ::= {mantissa 1024, base 2, exponent -10}
>
> the same abstract value as a?

Yes.

Ok, this can be concluded from Section B.3.2.5.e as well (thanks for
the reference).


> 2) Is it legal to have constraints on mantissa and/or exponent? For example:
>
> Rm ::= REAL (WITH COMPONENTS {..., mantissa (-999 .. 999)})

Yes, it's legal.

> Would the value c from above fulfill this constraint? (It should if it
> is the same abstract value as a)

Section B.3.2.5.e reads as follows:

    e) Each real value defined with base 2 is normalized
    so that the mantissa is odd, and each real value
    defined with base 10 is normalized so that the last
    digit of the mantissa is not 0.

As I understand it, value c should not violate the constraint since, when
normalized, the mantissa is within bounds. Nonetheless, I wouldn't say
that such a constraint makes much sense.

If this really matters (that is, is not purely an academic question),
please let me know and I'll investigate it further.


It is a bit academic, I am trying to do some tools and want to do it
right. I agree, that the constraint as written is not useful. But if
it is combined with a constraint on base it makes more sense. It
restricts the precision of the real number.

> 3) Does a REAL type with base constraint allow the special real values
> PLUS-INFINTY and MINUS-INFINITY? In other words, is this legal:
>
> Rb ::= REAL (WITH COMPONENTS {..., base(10)})
> d Rb ::= MINUS-INFINITY

Yes, it's fine.

Do you have any reference for that?

Many thanks for your answers,
Henry
_______________________________________________
Asn1 mailing list
[email protected]
http://lists.asn1.org/mailman/listinfo/asn1

Reply via email to