![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 | |
|
Professional Programmer
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4
![]() |
Quote:
|
|
|
|
|
|
|
#12 |
|
Expert Programmer
Join Date: Aug 2005
Location: Rotterdam, the Netherlands
Posts: 942
Rep Power: 4
![]() |
I like this one:
a = b (definition) a^2 = ab (multiply both sides with a) a^2 - b^2 = ab - b^2 (substract b^2) (a - b)(a + b) = b(a - b) (factor) a + b = b (delete the same terms) 2b = 1b (since a equals b) 2 = 1 ![]() has the same flaw as mjordan's, btw. |
|
|
|
|
|
#13 | |
|
The Supreme Ruler
![]() Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6
![]() |
Quote:
![]()
__________________
"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 |
|
|
|
|
|
|
#14 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Strange, MJ, that problem was on another forum I haunt in the last couple weeks.
__________________
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 |
|
|
|
|
|
#15 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Trolls only, eh? Suits ya.
![]() I've known about that one for a while - pretty clever. Anyway, back to converting an integer to a polynomial... to the OP: best think about what you're trying to do. It sure as hell ain't "converting", whatever that's supposed to mean. It might be integrating, as pal suggests... |
|
|
|
|
|
#16 |
|
Newbie
Join Date: Mar 2006
Posts: 3
Rep Power: 0
![]() |
what i meant by integer to polynomial is: suppose you have a very big number that can't be represented by a built-in integer data type. so you can take this number as a string, convert to a polynomial, do the operations like addition and than convert the result to a string and print. sth like 19375343 is 1*x^7 +9*x^6+....+4*x^1+3*x .
|
|
|
|
|
|
#17 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Why would you use a string? Just make your own datatype:
class ReallyLong
{
long number[8];
// insert code to manage stuff
} |
|
|
|
|
|
#18 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Shoot, if that's what you need, why don't you just get a bignum library?
__________________
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 |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|