note 50082 deleted from language.types.float by felipe

From: Date: Sun, 09 Dec 2007 13:07:15 +0000
Subject: note 50082 deleted from language.types.float by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-133062@lists.php.net to get a copy of this message
Note Submitter: edsko at edsko dot net ---- The formal specification of the floating point numbers as specified above is not complete. For one thing, it is not immediately obvious which of the three rules describes "floating point numbers" (in general). The disjunction of all three perhaps? My interpretation is that a floating point number is either a DNUM or an EXPONENT_DNUM. Moreover, the specification as stated does not allow for signs (+ or -). Yet, PHP does actually allow for signs in the specification of floating point numbers (as one would expect): <?php $f = (float) "-0.5"; var_dump($f); // outputs "float(-0.5)" ?> Thus, the following specification is more complete: FLOAT [+-]?({DNUM}|{EXPONENT_DNUM}) LNUM [0-9]+ DNUM ([0-9]*[\.]{LNUM}) | ({LNUM}[\.][0-9]*) EXPONENT_DNUM ( ({LNUM} | {DNUM}) [eE][+-]? {LNUM})

« previous php.notes (#133062) next »