• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Polynomial

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Below I tried to describe a complex polynomial which is a part of my newton method. When I define the complex number x, for example x = new ComplexNumber (0,0), it doesn't return the right value. Also I have overriden the basic string format to make it look like a complex number, but it doesn't show. It does show if I perform an arithmic operation like when I test a method. As a beginner I am clueless.

btw all methods for the complex arithmetic operations are defined and tested, ComplexNumber(real part, imaginary part)



note: My first attempt I tried to split the polynomial into a real and an imaginary part, but that doesn't work well when the root is also a complexnumber... So I moved on to the above.
 
Marshal
Posts: 79180
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch

Please go through that expression and work out what sort of algebraic formula it corresponds to. Use a pencil and paper and work from right to left; every time you reach a dot put round brackets () around your expression. See whether that gives the correct formula.
I don't understand the bit about "String". Do you mean what you get when you print the ComplexNumber to screen?
 
Campbell Ritchie
Marshal
Posts: 79180
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you got it to work?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic