This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GCC Hexadecimal Floating point constant handling


GCC accepts constructs such as :  float p = 0x.p5;


As per C99 Standards the grammar for hexadecimal floating points is as
follows : 
hexadecimal-floating-constant:
                                        hexadecimal-prefix
hexadecimal-fractional-constant
                                                            
binary-exponent-part floating-suffix(opt)
                                        hexadecimal-prefix
hexadecimal-digit-sequence
                                                            
binary-exponent-part floating-suffix(opt)

hexadecimal-prefix: one of
                           0x 0X

hexadecimal-fractional-constant:
                                        hexadecimal-digit-sequence(opt) .
hexadecimal-digit-sequence
                                        hexadecimal-digit-sequence .

binary-exponent-part:
                                        p signopt digit-sequence
                                        P signopt digit-sequence

hexadecimal-digit-sequence:
                                        hexadecimal-digit
                                        hexadecimal-digit-sequence
hexadecimal-digit

floating-suffix: one of
                     f l F L


As per the grammar to my understanding, the above construct is invalid. 
Just wanted to know whether the support for the above construct is a GCC
Extension or my understanding of the grammar is incorrect?
-- 
View this message in context: http://old.nabble.com/GCC-Hexadecimal-Floating-point-constant-handling-tp26191496p26191496.html
Sent from the gcc - Help mailing list archive at Nabble.com.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]