Ha, every solution brings another problem :-P. I don't know quite what it is about exception handling, but I'm resistant to doing it. I guess I'm more concerned with how my code looks than how the...
Type: Posts; User: Mozza314
Ha, every solution brings another problem :-P. I don't know quite what it is about exception handling, but I'm resistant to doing it. I guess I'm more concerned with how my code looks than how the...
Updated with lambda functions and boost::lexical_cast. I also decided to go with fp for the derivative name instead of fPrime, and that x is a less arbitrary initial guess than x / 2.
#include...
Ah yes boost::lexical_cast would be better. I'm not very familiar with C++0x's lambda functions, can they be used in that program without changing NewtonsMethod() ?
For a bit of fun, I thought I'd write my version of this program. Criticisms encouraged :-).
#include <cassert>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include...