Re: [PHP] A dumb question

2004-02-12 Thread Jeremy Schroeder
Sorry for the mistake.

I check the email I sent and I only sent it to the group,  I changed the 
subject an removed all the of the message.

Blake

David T-G wrote:

Jeremy --

You have started a new thread by taking an existing message and replying
to it while merely changing the Subject: line.
That is bad, because it breaks threading.  Whenever you reply to a
message, your mail client generates a "References:" header that tells all
recipients to which posting(s) your posting refers.  A mail client uses
this information to build a "thread tree" of the postings so that it is
easy to see just how they relate to each other.
With your posting style you successfully torpedoed this useful feature;
your posting shows up within an existing thread even though it is
completely unrelated.
Always do a fresh post when you want to start a new thread.  That means
that you do not select any sort of "Reply" when you start your message.
You can save the list address in your address book (or equivalent) for
convenience.
...and then Jeremy Schroeder said...
% 
% Hey Group

Hi!

% 
% I am starting to write class and objects and came across some syntax 
% that I dont understand.
% 
% What does the ampersand do in the bottom example code, they both work.
% 
% $n1 = $num1 -> function();
% $n1 = & $num1 -> function();

1) Search the manual.

2) Assigning by reference, as compared to the default assigning by value,
means that the variable on the left of the '=' now points to the very
same little chunk of memory as the variable on the right.  This is
different from the usual assignment in that when you change the left var
you change the value for the right var, too.
 $a = 1 ;
 $b = $a ;
 $c = &$a ;
 $b++ ; $c-- ;
 print "a = $a ; b = $b ; c = $c ;\n" ;
 // a = 0 ; b = 2 ; c = 0
3) You can't, as far as I know, assign-by-reference a function, so your
code should generate a parse error.
% 
% -Blake

HTH & HAND

:-D
 

--

+-+-++
| Blake Schroeder | Owner/Developer |lhwd.net|
+--(http://www.lhwd.net)+--/3174026352\--+
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] A dumb question

2004-02-11 Thread Jeremy Schroeder
Hey Group

I am starting to write class and objects and came across some syntax 
that I dont understand.

What does the ampersand do in the bottom example code, they both work.

$n1 = $num1 -> function();
$n1 = & $num1 -> function();
-Blake

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Math Question

2004-02-11 Thread Jeremy Schroeder
Thanks for all the help, floor() was the correct choice for this problem .

-Blake

Vincent Jansen wrote:

Hi Richard

I agree
But you always want to round down ;)
Blake> Is there a function that when you divide 2 numbers you drop the 
Blake> remainder and are left with the whole number.

Still seems floor() to me

Vincent



-Original Message-
From: Richard Davey [mailto:[EMAIL PROTECTED] 
Sent: woensdag 11 februari 2004 15:23
To: Vincent Jansen
Cc: [EMAIL PROTECTED]
Subject: Re[2]: [PHP] Math Question

Hello Vincent,

Wednesday, February 11, 2004, 2:15:15 PM, you wrote:

VJ> Seems to me you need
VJ> floor($number1 / $number2)
Only if you always want to round *down* the equation. For example
flooring a result of 4.99 will give you an integer of 4 whereas
round() (or ceil()) will give you 5. It depends on the situation as to
which is most useful.
 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Math Question

2004-02-11 Thread Jeremy Schroeder
Hey group

Is there a function that when you divide 2 numbers you drop the 
remainder and are left with the whole number.

--

Blake

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php