Thread: Homework Help...?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    3) Given the initialization: double z1 = 1.0, z2 = z1/2; use z1,z2 as a two-point sliding window (i.e. z1=z2; z2=z1/2; slides the window) and write a loop to find the value of z1 such that 1 + z1 is greater than 1 but 1 + z2 is equal to 1.
    I am guessing this is a way to calculate epsilon; but, I am not sure.
    How to (portably) get DBL_EPSILON in C/C++ - Stack Overflow

    I kept getting the wrong value for epsilon; turns out the compiler optimizes the code and results in LDBL_EPSILON under MinGW GCC.
    http://en.wikipedia.org/wiki/Machine...mation_using_C

    Tim S.
    Last edited by stahta01; 03-21-2013 at 10:14 PM.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  2. #2
    Registered User
    Join Date
    Mar 2013
    Posts
    7
    Quote Originally Posted by stahta01 View Post
    I am guessing this is a way to calculate epsilon; but, I am not sure.
    How to (portably) get DBL_EPSILON in C/C++ - Stack Overflow

    I kept getting the wrong value for epsilon; turns out the compiler optimizes the code and results in LDBL_EPSILON under MinGW GCC.
    Machine epsilon - Wikipedia, the free encyclopedia

    Tim S.
    ???

    Sorry, but I have no clue what this means. I really wish I knew C

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help me with my c++ homework please
    By dmeyers81 in forum C++ Programming
    Replies: 5
    Last Post: 12-05-2010, 09:26 PM
  2. Please help me with my c++ homework!
    By dmeyers81 in forum C++ Programming
    Replies: 4
    Last Post: 11-30-2010, 08:06 PM
  3. Help for Homework!
    By alionas in forum C Programming
    Replies: 4
    Last Post: 11-20-2010, 10:36 AM
  4. Homework
    By cagurtay in forum C Programming
    Replies: 3
    Last Post: 11-01-2010, 05:28 PM
  5. homework help
    By computerjunkie5 in forum C++ Programming
    Replies: 13
    Last Post: 10-27-2003, 11:54 AM