FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Something I have never seen before
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Something I have never seen before [message #169464 is a reply to message #169461] Tue, 14 September 2010 06:54 Go to previous messageGo to previous message
Erwin Moller is currently offline  Erwin Moller
Messages: 228
Registered: September 2010
Karma:
Senior Member
On 9/14/2010 2:21 AM, Jerry Stuckle wrote:
> On 9/13/2010 8:07 PM, sheldonlg wrote:
>> In all my years of programming here is something I have never seen
>> before (that actually happened in a program:
>>
>> $b = array('5', '3');
>> $a = (count($b) + 1)/2;
>> print 'count = ' . count($b) . '<br>';
>> print 'a = ' . $a;
>>
>>
>> Output:
>> =======
>> count = 2
>> a = 1.5
>>
>> I just don't understand how this is possible, that a is not one.
>>
>
> (2 + 1) / 2 = 1.5.
>
> How could it be anything else?
>

Indeed. Sheldonlg must have a bad day.
I know how that feels. ;-)

My advise: Take a day or two to relax, then code on.

Regards,
Erwin Moller

--
"There are two ways of constructing a software design: One way is to
make it so simple that there are obviously no deficiencies, and the
other way is to make it so complicated that there are no obvious
deficiencies. The first method is far more difficult."
-- C.A.R. Hoare
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Function that returns name of itself?
Next Topic: Last element in an array?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 16:48:08 GMT 2024

Total time taken to generate the page: 0.04262 seconds