Forums: » Register « |  Free Tools |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |

New Free Tools on Dev Shed!

#1
December 6th, 2012, 06:47 PM
 davidramos21
Registered User

Join Date: Dec 2012
Posts: 1
Time spent in forums: 23 m 20 sec
Reputation Power: 0

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.

#2
December 6th, 2012, 07:51 PM
 Scorpions4ever
Banned ;)

Join Date: Nov 2001
Location: Woodland Hills, Los Angeles County, California, USA
Posts: 9,534
Time spent in forums: 2 Months 3 Days 4 h 40 m 8 sec
Reputation Power: 4106
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

#3
December 7th, 2012, 12:46 PM
 b49P23TIvg
Contributing User

Join Date: Aug 2011
Posts: 4,115
Time spent in forums: 1 Month 3 Weeks 2 Days 3 h 56 sec
Reputation Power: 455
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.

Code:
2      3
y(x) = 1 + 4 x  - 3 x

1+4x**2-3x**3

although the latter would paste functionally directly into python and many other languages.
__________________
[code]Code tags[/code] are essential for python code!

 Viewing: Dev Shed Forums > Programming Languages > C Programming > Programming C work about polynomials