Changeset 47 for trunk/ext/php
- Timestamp:
- 03/30/2003 20:35:54 (6 years ago)
- Files:
-
- 1 modified
-
trunk/ext/php/phpext.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ext/php/phpext.c
r42 r47 18 18 #include "ext/standard/info.h" 19 19 #include "php_syck.h" 20 21 static double zero() { return 0.0; } 22 static double one() { return 1.0; } 23 static double inf() { return one() / zero(); } 24 static double nan() { return zero() / zero(); } 20 25 21 26 /* {{{ syck_functions[] … … 176 181 else if ( strcmp( n->type_id, "float" ) == 0 ) 177 182 { 178 //double floatVal = strtol( n->data.str->ptr ); 179 ZVAL_DOUBLE( o, 3.45 ); 183 double f; 184 syck_str_blow_away_commas( n ); 185 f = strtod( n->data.str->ptr, NULL ); 186 ZVAL_DOUBLE( o, f ); 187 } 188 else if ( strcmp( n->type_id, "float#nan" ) == 0 ) 189 { 190 ZVAL_DOUBLE( o, nan() ); 191 } 192 else if ( strcmp( n->type_id, "float#inf" ) == 0 ) 193 { 194 ZVAL_DOUBLE( o, inf() ); 195 } 196 else if ( strcmp( n->type_id, "float#neginf" ) == 0 ) 197 { 198 ZVAL_DOUBLE( o, -inf() ); 180 199 } 181 200 else