present value - previous value in c

This is a discussion on present value - previous value in c within the C Programming forums, part of the General Programming Boards category; im currently working on a program using bisection method and my tolerance is 0.01 but i dont know how to ...

  1. #1
    Registered User
    Join Date
    Mar 2013
    Posts
    2

    present value - previous value in c

    im currently working on a program using bisection method

    and my tolerance is 0.01

    but i dont know how to do the

    Ed = present value - previous value

    Ed is my tolerance
    thanks

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,762
    What do you mean you don't know how to do it?

    What you wrote looks exactly how to do it.

    I suppose you could follow it with
    if ( fabs(Ed) < 0.01 )

    but that's about it.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Mar 2013
    Posts
    2
    we should display every value of Ed in our prog until we reach 0.01

    sorry im completely newbie on this

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,762
    OK, so call printf

    What's your question?

    > sorry im completely newbie on this
    So does this mean you have any code at all?

    Because "im currently working on a program using bisection method " really does imply that you've got past the hello world stage, and should be comfortable with simple user I/O with printf and scanf.
    Replying with "newbie" and "how to print" is not a good sign that you've made any progress on the complicated part of the assignment.

    Post the code you have at the moment, then we can help you properly.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. I present to cprogramming.com: Prongject X
    By Shamino in forum Game Programming
    Replies: 7
    Last Post: 04-03-2009, 03:19 AM
  2. My birthday present to myself
    By Liger86 in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 01-25-2003, 09:49 PM
  3. Here's my little x-mas present to all you guys...
    By funkydude9 in forum Game Programming
    Replies: 4
    Last Post: 12-25-2002, 05:31 PM
  4. My christmas present :D
    By RoD in forum A Brief History of Cprogramming.com
    Replies: 22
    Last Post: 12-22-2002, 02:06 PM

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