Data type problem

This is a discussion on Data type problem within the C++ Programming forums, part of the General Programming Boards category; I have the following code which calculates Legende's polynomials. Code: ((2*n-1)*x*leg(n-1, x) - (n-1)*leg(n-2, x))/n The problem is that the ...

  1. #1
    843
    843 is offline
    Registered User
    Join Date
    Oct 2010
    Posts
    135

    Data type problem

    I have the following code which calculates Legende's polynomials.

    Code:
    ((2*n-1)*x*leg(n-1, x) - (n-1)*leg(n-2, x))/n
    The problem is that the function doesn't work when I input negative parameters. Is there something I'm missing?

    EDIT: Okay, I'm an idiot. n is not supposed to be a negative.
    Last edited by 843; 03-19-2011 at 10:32 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Packet Container Class
    By ChaoticXSinZ in forum C++ Programming
    Replies: 2
    Last Post: 11-01-2010, 01:07 AM
  2. Memory Leak in AppWizard-Generated Code
    By jrohde in forum Windows Programming
    Replies: 4
    Last Post: 05-19-2010, 05:24 PM
  3. data type problem
    By td4nos in forum C Programming
    Replies: 3
    Last Post: 06-02-2009, 10:49 AM
  4. Reading a file with Courier New characters
    By Noam in forum C Programming
    Replies: 3
    Last Post: 07-07-2006, 10:29 AM
  5. ras.h errors
    By Trent_Easton in forum Windows Programming
    Replies: 8
    Last Post: 07-15-2005, 11:52 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21