Re: [PHP-DEV] Object arithmetic

2007-10-18 Thread Stanislav Malyshev
In this case, the proper solution is to force SimpleXML to cast values to strings, because, after all, XML has nothing but strings. Then + operator requires numeric values. SimpleXML can't return string when asked for numeric value. The problem is while + can accept both int and float, it

Re: [PHP-DEV] Object arithmetic

2007-10-18 Thread Rob Richards
Stanislav Malyshev wrote: While looking at bug 42780: http://bugs.php.net/bug.php?id=42780 The only way not to lose precision is to explicitly cast the object to float or string, which just doesn't seem right to me. I'm not sure how this can be fixed - there should be some type used and many

Re: [PHP-DEV] Object arithmetic

2007-10-17 Thread Stanislav Malyshev
While looking at bug 42780: http://bugs.php.net/bug.php?id=42780 The only way not to lose precision is to explicitly cast the object to float or string, which just doesn't seem right to me. I'm not sure how this can be fixed - there should be some type used and many objects won't provide

Re: [PHP-DEV] Object arithmetic

2007-10-17 Thread Alexey Zakhlestin
On 10/18/07, Stanislav Malyshev [EMAIL PROTECTED] wrote: While looking at bug 42780: http://bugs.php.net/bug.php?id=42780 The only way not to lose precision is to explicitly cast the object to float or string, which just doesn't seem right to me. I'm not sure how this can be fixed - there

[PHP-DEV] Object arithmetic

2007-10-10 Thread Rob Richards
I was wondering why objects are always converted to longs when performing arithmetic. While looking at bug 42780: http://bugs.php.net/bug.php?id=42780 The only way not to lose precision is to explicitly cast the object to float or string, which just doesn't seem right to me. It would be nice