# 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:

M * B E

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

M ::= INTEGER

B ::= INTEGER (2 | 10)

E ::= INTEGER

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:

e REAL ::= {2718281828459045235360287, 10, -24}

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

PositiveReal1 ::= (0< .. MAX)

PositiveReal2 ::= (0< .. PLUS-INFINITY)

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