473,386 Members | 1,819 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 am sorry but I couldnt find the solving

/////////////////////// DIVISION FUNCTION ////////////////////
void div ( int pol1[] , int pol1p[] , int pol2[] , int pol2p[])
{
int r=0,z,i,g,j,k,l,dividend[6],rising[6]={0};
for (i=0 ; i<6 ; i++)
dividend[i]=pol1[i];
for(i=5 ; i >=0 ; i--)
{
if(dividend[i]!=0)
{
for(z=5 ; z>=0 ; z--)
{

if(pol2[z]!=0)
{
*(po5 + (i-z))= dividend[i]/pol2[z];
r++;
for(l=0; l<6; l++)
rising[l]=0;
for (j=z ; j>=0 ; j--) {
rising[i+j-z] += (*(po5 + i-z) * pol2[j]);
}
for(k=0; k<6 ; k++) {
dividend[k] = dividend[k] - rising[k];
}
}
}
}
}

this is my code, its for 2 poly which max power is 5 and I have to
divide them but it sometimes divide right,sometimes divide wrong,
can you see the problem?
Nov 16 '07 #1
2 1297
emre esirik(hacettepe computer science and engineering) said:
/////////////////////// DIVISION FUNCTION ////////////////////
void div
You have already been told at least twice that your function's name clashes
with the name of a function in the standard library. Since you haven't
shown any sign of understanding and heeding that advice, you'll find it
hard to persuade anyone that it's worth trying to help you with advice
that may turn out to be even more complicated.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Nov 16 '07 #2
On Nov 16, 6:08 am, "emre esirik(hacettepe computer science and
engineering)" <emreesi...@gmail.comwrote:
/////////////////////// DIVISION FUNCTION ////////////////////
void div ( int pol1[] , int pol1p[] , int pol2[] , int pol2p[])
{
int r=0,z,i,g,j,k,l,dividend[6],rising[6]={0};
for (i=0 ; i<6 ; i++)
dividend[i]=pol1[i];
for(i=5 ; i >=0 ; i--)
{
if(dividend[i]!=0)
{
for(z=5 ; z>=0 ; z--)
{

if(pol2[z]!=0)
{
*(po5 + (i-z))= dividend[i]/pol2[z];
r++;
for(l=0; l<6; l++)
rising[l]=0;
for (j=z ; j>=0 ; j--) {
rising[i+j-z] += (*(po5 + i-z) * pol2[j]);
}
for(k=0; k<6 ; k++) {
dividend[k] = dividend[k] - rising[k];
}
}
}
}
}

this is my code, its for 2 poly which max power is 5 and I have to
divide them but it sometimes divide right,sometimes divide wrong,
can you see the problem?
C:\tmp>splint div.c
Splint 3.1.1 --- 12 Mar 2007

div.c(1,17): Function div inconsistently declared to return void
A function, variable or constant is redefined with a different type.
(Use
-incondefs to inhibit warning)
load file standard.lcd: Specification of div: div_t
div.c(1,17): Function div declared with 4 args, specified with 2
Types are incompatible. (Use -type to inhibit warning)
load file standard.lcd: Specification of div
div.c(1,25): Parameter 1, pol1, of function div has inconsistent type:
declared int [], specified int
load file standard.lcd: Specification of pol1: int
div.c(1,37): Parameter 2, pol1p, of function div has inconsistent
type:
declared int [], specified int
load file standard.lcd: Specification of pol1p: int
div.c: (in function div)
div.c(12,5): Initializer block for rising has 1 element, but declared
as int
[6]: 0
Initializer does not define all elements of a declared array. (Use
-initallelements to inhibit warning)
div.c(20,23): Unrecognized identifier: po5
Identifier used in code has not been declared. (Use -unrecog to
inhibit
warning)
div.c(6,21): Variable g declared but not used
A variable is declared but never used. Use /*@unused@*/ in front of
declaration to suppress message. (Use -varuse to inhibit warning)
div.c(1,37): Parameter pol1p not used
A function parameter is not used in the body of the function. If the
argument
is needed for type compatibility or future plans, use /*@unused@*/
in the
argument declaration. (Use -paramuse to inhibit warning)
div.c(1,62): Parameter pol2p not used

Finished checking --- 9 code warnings
Nov 16 '07 #3

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

Similar topics

7
by: zhou | last post by:
Hi there, We have a compiler specific issue which requires us to force template instantiation. This works fine. The problem comes when I try using std:find() on vector. Since vector has no member...
15
by: anand | last post by:
Dear all, I am trying to "find the area under the curve f(x)=sin(x)/x for x=1 to 3" a) Use the trapezoidal rule method. Prove that your trapezoidal rule method is second order accurate...
4
by: KL | last post by:
Hello again, I am still working on this homework assignment and have hit a wall. I have a list that I want to fill with all occurences of img tags from a big string of html code. So I have a...
11
by: Saurabh | last post by:
Hi all, I want to know why do we use libraries(static or shared). We can perform that work by including header files too.I also wish to know what exactly is linking and loading. i know these...
14
by: Daniel | last post by:
Hi guys who just answered me.....it really would have helped if i had written it right. Ok i will use better names to explain my problem. I have this: InterFaceClass ^ ClassA
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...
2
by: Mads Lee Jensen | last post by:
Sorry for posting this message again. Im new with the google groups and something seems wrong maybe it is because i changed my email after posting to a valid email i noticed the other didnt exists...
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:
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,...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.