1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
namespace Spreadsheetns {
ACosFormula::ACosFormula() {
//empty
}
ACosFormula::ACosFormula(IFormula* formula) : IOneArgFormula(formula) {
if((formula->getResult() < -1) || (formula->getResult() > 1)) {
throw DomainErrorException("acos is defined in de range [-1 , 1]");
}
}
double ACosFormula::getResult(){
if((fArgument->getResult() < -1) || (fArgument->getResult() > 1)) {
throw DomainErrorException("acos is defined in de range [-1 , 1]");
}
return (acos(fArgument->getResult()) * 180/DEF_PI);
}
}
namespace foo {
class bar {
bar() {};
};
namespace foo1 {
class bar {
bar() {};
};
}
int fff(void) {
}
};
class bar {
bar() {};
};
namespace {
class bar {
bar() {};
};
}
// Inspiration for adding namespaces and some of this test come
// from Bart Van Rompaey
|