-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ryan Dillinger wrote:
> Hello,
> I have written this script. I have a good understanding of all but line:
> $return = ($end - $start) / $start * 100;
If you start with 1000 and end with 900, you have:
(900 - 1000) / 1000 * 100 = -100 / 1000 * 100 = -0.1 * 100 = -10

If it were ($end - $start) / ($start * 100), *then* it would be
different (just go by the order of operations, or perldoc perlop).

> #!/usr/bin/perl
> use warnings;
Try using strict as well :)

Hope this helps,
Ricky
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFGrOezZBKKLMyvSE4RAtSvAJ45NM5C/ojyR4XLwkNFQw6W8QkTjgCgwbew
c8FyKlkVzMAIT5wqUxuaIxQ=
=ctVO
-----END PGP SIGNATURE-----

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to