![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Mar 2006
Posts: 3
Rep Power: 0
![]() |
integer number to polynomial
how can i convert an integer number to a polynomial? (i'm using c++)
|
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Neglecting the language, do you know how to convert an integer to a polynomial, otherwise? If not, the language is of no consequence.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
The Supreme Ruler
![]() Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6
![]() |
How would one convert an integer to a polynomial anyway? An integer is just a number, a polynomial is a multi-termed expression, or am I wrong?
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower |
|
|
|
|
|
#4 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
You are correct.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#5 |
|
Programming Guru
![]() Join Date: Oct 2004
Location: namespace std
Posts: 1,246
Rep Power: 5
![]() |
x^2 + 3*x - 7 = ???
there are limitless possibilities
__________________
i put on my robe and wizard hat... Have you ever heard of Plato, Aristotle, Socrates?...Morons. |
|
|
|
|
|
#6 |
|
Battle Programmer
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 754
Rep Power: 3
![]() |
42, obviously... (x ~= 5.65)
|
|
|
|
|
|
#7 |
|
Programmer
Join Date: Mar 2005
Location: Washington
Posts: 90
Rep Power: 4
![]() |
well you can integrate integers in to polynomials.
for example, let say you have two integers (3 and 4). polynomial would be. int result = (3 * x) + (4 *y); now you might want to obviously define those variables if you want to. But since polynomials are there mathematically to solve for a variable, you might want to solve for one of those two x and y variables, if you already have a value of one those two (in terms of algebra). will be able to code it. might have to actually recognize those as a string or char arrays to fiddle around like soliving algebraic problems. char and integer or string and integer conversions could be used as well, I'm sure there are many other ways too. |
|
|
|
|
|
#8 | ||
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Quote:
Quote:
BRACCCCCCCCKKKKKKKKKKKKKKK!!!!!!!!!!! Bad answer, bad answer!!!
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
||
|
|
|
|
|
#9 |
|
Professional Programmer
Join Date: Jun 2005
Location: India, The great.
Posts: 435
Rep Power: 4
![]() |
Let me take a dig at that...
An integer can be represented as a polynomial. Just put an X^0 next to it.
__________________
PFO - My daily dose of technology. |
|
|
|
|
|
#10 | |
|
The Supreme Ruler
![]() Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6
![]() |
Quote:
![]() Given that X=1: x^2 = X x^2-1 = X - 1 (X-1)(X+1) = (X-1) X+1 = 1 2 = 1 :p Found this on a site, found it quite intresting.
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|