473,386 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

I couldnt find what is wrong

void div ( int pol1[] , int pol1p[] , int pol2[] , int pol2p[])
{
int r=5,z,i,g,j,k;
for (i=0 ; i<6 ; i++)
*(po5 + i)=pol1[i];
for(i=5 ; i >=0 ; i--)
{

for(z=r ; z>=0 ; z--)
{

if(pol2[z]!=0)
{
*(po5 + (i-z))= *(po5 + i)/pol2[z];

for(g=5; g>=0 ; g--) {
for (j=z ; j>=0 ; j--) {
*(po5 + (g+j)) += (*(po5 + j) * pol2[g]);
}
}
for(k=0; k<6 ; k++) {
*(po5 + k) = *(po5 + k) - pol2[k];
}

}
r=z-1;
}

}
for (i=0 ; i<6 ; i++) {
printf("%dX^%d+",*(po5+i),i);
}
}
Nov 15 '07 #1
1 1275
it doesnt calculate two polynom division
Nov 15 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Phil Powell | last post by:
if (is_array($_POST)) { foreach ($this->getAssocSectionsObjArray($key, $dbAP) as $obj) { print_r($obj); print_r(" in array? "); print_r(in_array($obj, $result)); print_r("<P>"); if...
2
by: Sims | last post by:
Hi, I have a structure as follow struct sIntStructure { int m_nNumber; // // A few more variables //
1
by: Adam Teasdale Hartshorne | last post by:
I would be extremely grateful if somebody could tell me what as I getting wrong with this little bit of code to find the index of a particular element in a std::vector std::vector<int>...
6
by: Jon Jagger | last post by:
I was thinking about how you can only use sizeof to find the size of an unmanaged type. I started to wonder if there was a way to find the size of a managed object and came up with the following....
9
by: Tony Girgenti | last post by:
Hello. I'm developing and testing a web application using VS.NET 2003, VB, .NET Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1 on a WIN XP Pro, SP2 computer. I'm using a web form. For a...
1
by: nmn | last post by:
thank you in advance.. i am trying to retrive data to my txt fields from access tables by using dbcombo i am using DATA1 for the datasource and "car" for the table. i have no problem in listing...
5
by: emre esirik(hacettepe computer science and enginee | last post by:
/////////////////////// DIVISION FUNCTION //////////////////// void div ( int pol1 , int pol1p , int pol2 , int pol2p) { int r=5,z,i,g,j,k,l,dividend,rising={0}; for (i=0 ; i<6 ; i++)...
2
by: emre esirik(hacettepe computer science and enginee | last post by:
/////////////////////// DIVISION FUNCTION //////////////////// void div ( int pol1 , int pol1p , int pol2 , int pol2p) { int r=0,z,i,g,j,k,l,dividend,rising={0}; for (i=0 ; i<6 ; i++)...
2
by: emre esirik(hacettepe computer science and enginee | last post by:
struct guitar active; char *buffer_char3; while(!feof(ptdata)) { fgets(buffer,26, ptdata); fgets(buffer,26, ptdata); fgets(buffer,26, ptdata); fgets(buffer,26, ptdata); fgets(buffer,26,...
19
by: eMRe | last post by:
class A { .. }; class B : public A { .. }; int main( ) {
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.