HP 3000 Manuals

Floating Constants [ HP C/iX Reference Manual ] MPE/iX 5.0 Documentation


HP C/iX Reference Manual

Floating Constants 

Floating constants represent floating-point values.

Syntax 

     floating-constant   ::=
          fractional-constant [exponent-part] [floating-suffix] 
          digit-sequence exponent-part [floating-suffix] 
     fractional-constant   ::=
          [digit-sequence] . digit-sequence 
          digit-sequence .

     exponent-part  ::=
          e [sign] digit-sequence 
          E [sign] digit-sequence 

     sign ::=
          +
          -

     digit-sequence  ::=
          digit 
          digit-sequence digit 

     floating-suffix  ::=
          F
          f
          L
          l


NOTE Suffixes in floating-constants are available only in ANSI mode.
Description A floating constant has a value part that may be followed by an exponent part and a suffix specifying its type. The value part may include a digit sequence representing the whole-number part, followed by a period (.), followed by a digit sequence representing the fraction part. The exponent includes an e or an E followed by an exponent consisting of an optionally signed digit sequence. Either the whole-number part or the fraction part must be used; either the period or the exponent part must be used. The format of floating-point numbers is given in Chapter 9, HP C/iX Implementation Topics. A floating constant may include a suffix that specifies its type. F or f specifies type float (single precision). L or l specifies long double (quad precision). The default type (unsuffixed) is double. Examples 3.28e+3f float constant = 3280 6.E2F float constant = 600 201e1L long double constant = 2010 4.8 double constant = 4.8


MPE/iX 5.0 Documentation