Evaluating a polynomial?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Evaluating a polynomial?

  1. #1
    Join Date
    Mar 2017
    Posts
    6

    Evaluating a polynomial?

    How do I evaluate the polynomial 3x^3-5x^2+6
    x=2.55


    Using Codelite

  2. #2
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    5,787

    Re: Evaluating a polynomial?

    [This is the Microsoft Visual c++ programming forum. I've moved this thread to the c++ forum.]

    Cheers.
    All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/

    C++17 Compiler: Microsoft VS2017 (15.4.1)

  3. #3
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    5,787

    Re: Evaluating a polynomial?

    How do I evaluate the polynomial 3x^3-5x^2+6
    x=2.55
    Code:
    double x = 2.55;
    double p = 3.0 * x * x * x - 5.0 * x * x + 6.0;
    All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/

    C++17 Compiler: Microsoft VS2017 (15.4.1)

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    18,969

    Re: Evaluating a polynomial?

    Quote Originally Posted by jamsdolpw View Post
    How do I evaluate the polynomial 3x^3-5x^2+6
    x=2.55


    Using Codelite
    Didn't you learn the base things of C/C++ programming?
    Then you should first learn it and only after that go back to this forum!
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This a Codeguru.com survey!


On-Demand Webinars (sponsored)