Calculator Script

From: Date: Tue, 20 Apr 2004 21:40:46 +0000
Subject: Calculator Script
Groups: php.general 
Request: Send a blank email to php-general+get-184060@lists.php.net to get a copy of this message
This isn't exactly PHP, but I do plan to translate this program to PHP, but first I need to know if it's even worth my time. I ran accross this program in my math book today and I wasn't sure what exactly it's doing. Below is what it says it does, and then the actual script. "Helps you find the quotient and remainder when you divide a polynomial of the form ax^2 + bx + c by a binomial of the form x - r. You enter the values of a, b, c, and r when prompted." PROGRAM; POLYDIV : Disp "ENTER A,B,C" : Prompt A: Prompt B: Prompt C : Disp "ENTER R" : Prompt R : Disp "COEFFICIENTS" : Disp "OF QUOTIENT:" : Disp A : Disp B+A*R : Disp "REMAINDER:" : Disp C+B*R+A*R^2 One example I tried out was (b^2 + 9b - 7) / 3b. I worked out all that it displays and I get the following: A = 1 B+A*R = 9 C+B*R+A*R^2 = -7 I get (b/3) + 3 - (7/3b) when I work it out by hand, and a teacher of mine got the same thing. What exactly is this program finding, since it obviously isn't any coefficients? Thanks, Stephen Craton http://www.melchior.us

« previous php.general (#184060) next »