Problema con una simple suma ...

[email protected] (hackob)
Newsgroups php.general.es
Message-ID <[email protected]>
Tengo un programa que hace algo más o menos así :

#!/usr/bin/php -q

<?php

        $var1 = (float)'0.09';
        $var2 = (float)'+0.10E-01';
        $varR = $var1 + $var2;
        echo "varR = $varR\n";

?>

Lo curioso y tontería mía es que al ejecutarlo da como resultado "varR
= 0.0:", con los ":" incluidos:

$ ./test.php

varR = 0.0:
$

Me pueden por favor decir cual es mi error?, cabe mencionar que si
cambio la variable $var2 a 0.01 da el mismo resultado incluso si no
hago cast ni nada de esto.

Gracias,
@hackob
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.