Newer
Older
Lecture_repo / Lectures_my / NumMet / 2016 / Lecture3 / examples / ex1.cc
@mchrzasz mchrzasz on 12 Oct 2016 332 bytes fixed small things
/* vim: set sw=4 sts=4 et foldmethod=syntax : */

#include <cmath>
#include <iostream>

double f(const double & h)
{
    return std::sin(h) / h;
}

int main(int, char **)
{
    for (unsigned i = 0 ; i < 5 ; ++i)
    {
        double h = std::pow(0.5, i);

        std::cout << h << "\t" << f(h) << std::endl;
    }

    return 0;
}