REAL

The REAL type is somehow a new adition to ASN.1, it was not included in early versions. This type is used, as all of you already expect, to aproximate a real value by rational numbers as usual in most of the programming languages. The values of REAL is expressible as:

where M is the mantissa, B is the base and E is exponent, all definable in ASN.1 syntax:

In addition to numbers expressible this way also 0, PLUS-INFINITY and MINUS-INFINITY keywords are added to express zero and both positive and negative infinities. The special notation of zero must be used instead of full one.

The type notation for the real type is simple - only the keyword REAL is needed.

The value notation provides for the values expressed in terms of M, B, E to be written as {M, B, E}. Thus popular Euler constant could be defined as:

Because of natural ordering in real numbers, value range subtyping can be used inclusive MAX and MIN keywords:

Both of these examples define the equal value subsets of REAL.