diff --git a/tests/resources/ATAN2.xlsx b/tests/resources/ATAN2.xlsx old mode 100644 new mode 100755 index 10665bc..6ca228f Binary files a/tests/resources/ATAN2.xlsx and b/tests/resources/ATAN2.xlsx differ diff --git a/tests/xlfunctions/test_math.py b/tests/xlfunctions/test_math.py index 87838a1..e0d44ad 100644 --- a/tests/xlfunctions/test_math.py +++ b/tests/xlfunctions/test_math.py @@ -41,6 +41,7 @@ def test_ATAN(self): def test_ARTAN2(self): self.assertAlmostEqual(math.ATAN2(1, 1), 0.785398163) self.assertAlmostEqual(math.ATAN2(-1, -1), -2.35619449) + self.assertAlmostEqual(math.ATAN2(1, 2), 1.10714872) def test_CEILING_number(self): self.assertEqual(math.CEILING(2.5, 1), 3) diff --git a/tests/xlfunctions_vs_excel/atan2_test.py b/tests/xlfunctions_vs_excel/atan2_test.py index e85dcc3..4c328f8 100644 --- a/tests/xlfunctions_vs_excel/atan2_test.py +++ b/tests/xlfunctions_vs_excel/atan2_test.py @@ -28,3 +28,9 @@ def test_evaluation_A5(self): self.evaluator.evaluate('Sheet1!A5'), self.evaluator.get_cell_value('Sheet1!A5') ) + + def test_evaluation_A6(self): + self.assertEqual( + self.evaluator.evaluate('Sheet1!A6'), + self.evaluator.get_cell_value('Sheet1!A6') + ) diff --git a/xlcalculator/xlfunctions/math.py b/xlcalculator/xlfunctions/math.py index f167fe8..621138f 100644 --- a/xlcalculator/xlfunctions/math.py +++ b/xlcalculator/xlfunctions/math.py @@ -111,7 +111,7 @@ def ATAN2( https://support.office.com/en-us/article/ atan2-function-c04592ab-b9e3-4908-b428-c96b3a565033 """ - return np.arctan2(float(x_num), float(y_num)) + return np.arctan2(float(y_num), float(x_num)) @xl.register()