Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TEST_METHOD(CalculationsRoundTests)
- {
- int result = Calculations::Round(1.0);
- Assert::AreEqual(1, result);
- }
- #ifdef EXPORT_TEST_FUNCTIONS
- #define MY_CALCULATIONS_EXPORT __declspec(dllexport)
- #else
- #define MY_CALCULATIONS_EXPORT
- #endif
- ...
- class CALCULATIONS_EXPORT Calculations {
- ...
- public:
- static int Round(const double& x);
- int Calculations::Round(const double& x)
- {
- int temp;
- if (floor(x) + 0.5 > x)
- temp = floor(x);
- else
- temp = ceil(x);
- return int(temp);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement