December 6th, 2012, 05:47 PM
Programming C work about polynomials
i have to do this work about polynomials, and i have to do some multiplications between two polynomials .
My problem is i have to put the formula of the polynomial after i multiplicate . and it has to be something like this :
" 1 + 2 x**2 + 3x**5"
I have to do some printf i guess, because it is not supposed to know the value of x and the values with 0 should not appear nor their x**n.
December 6th, 2012, 06:51 PM
Just to let you know, C and C++ don't have a ** operator. The equivalent for this is the pow() function.
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
"I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
December 7th, 2012, 11:46 AM
I take it you need to multiply the polynomials rather than evaluate them.
How are the coefficients entered?
What does the output need to look like?
Please show your programming effort, if by chance you can't make it work, and you'll get some advice.
y(x) = 1 + 4 x - 3 x
although the latter would paste functionally directly into python and many other languages.
[/code] are essential for python code and Makefiles!