How-To Calibrate American Options Really Fast in C++
tastyhedge.com
How-To Calibrate American Options Really Fast in C++
1–3 of 3 posts
Re: How-To Calibrate American Options Really Fast in C++
#2I've programmed in C++ only sporadically. Are the functions really declared to have type Error, or am I misreading things? For example one function starts as
Error
calibrateEuropean(
f64 v, // option price
f64 s, // stock priceRe: How-To Calibrate American Options Really Fast in C++
#3I've programmed in C++ only sporadically. Are the functions really declared to have type Error, or am I misreading things? For example one function starts as Error calibrateEuropean( f64 v, // option price f64 s, // stock price
Good observation!
Basically `Error` is an alias to `std::string`. This way code is more meaningful as returning just std::string is too generic.
It's also my convention to report errors as return arguments in this particular codebase, instead of throwing exceptions for example.