當前位置: 首頁>>代碼示例>>Python>>正文


Python EuclideanDivision.value方法代碼示例

本文整理匯總了Python中arithmeticExpressions.EuclideanDivision.value方法的典型用法代碼示例。如果您正苦於以下問題:Python EuclideanDivision.value方法的具體用法?Python EuclideanDivision.value怎麽用?Python EuclideanDivision.value使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在arithmeticExpressions.EuclideanDivision的用法示例。


在下文中一共展示了EuclideanDivision.value方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_evaluated_variable_self_litteral_euclideandivision

# 需要導入模塊: from arithmeticExpressions import EuclideanDivision [as 別名]
# 或者: from arithmeticExpressions.EuclideanDivision import value [as 別名]
 def test_evaluated_variable_self_litteral_euclideandivision(self):
     a1 = SelfLitteral()
     a2 = ALitteral(Variable('X'))
     expr = EuclideanDivision(a1, a2)
     self.assertEqual(expr.value(self.eval2, 2), 2)
開發者ID:mouton5000,項目名稱:DiscreteEventApplicationEditor,代碼行數:7,代碼來源:testEuclideanDivision.py

示例2: test_strings_euclideandivision_with_empty_evaluation

# 需要導入模塊: from arithmeticExpressions import EuclideanDivision [as 別名]
# 或者: from arithmeticExpressions.EuclideanDivision import value [as 別名]
 def test_strings_euclideandivision_with_empty_evaluation(self):
     a1 = ALitteral('abc')
     a2 = ALitteral('def')
     expr = EuclideanDivision(a1, a2)
     with self.assertRaises(TypeError):
         expr.value(self.eval1)
開發者ID:mouton5000,項目名稱:DiscreteEventApplicationEditor,代碼行數:8,代碼來源:testEuclideanDivision.py

示例3: test_undefined_self_litteral_euclideandivision_with_non_empty_evaluation

# 需要導入模塊: from arithmeticExpressions import EuclideanDivision [as 別名]
# 或者: from arithmeticExpressions.EuclideanDivision import value [as 別名]
 def test_undefined_self_litteral_euclideandivision_with_non_empty_evaluation(self):
     a1 = UndefinedLitteral()
     a2 = SelfLitteral()
     expr = EuclideanDivision(a1, a2)
     with self.assertRaises(TypeError):
         expr.value(self.eval2, 1)
開發者ID:mouton5000,項目名稱:DiscreteEventApplicationEditor,代碼行數:8,代碼來源:testEuclideanDivision.py

示例4: test_self_litteral_float_euclideandivision_with_empty_evaluation

# 需要導入模塊: from arithmeticExpressions import EuclideanDivision [as 別名]
# 或者: from arithmeticExpressions.EuclideanDivision import value [as 別名]
 def test_self_litteral_float_euclideandivision_with_empty_evaluation(self):
     a1 = SelfLitteral()
     a2 = ALitteral(sqrt(2))
     expr = EuclideanDivision(a1, a2)
     self.assertEqual(expr.value(self.eval1, 1), 0)
開發者ID:mouton5000,項目名稱:DiscreteEventApplicationEditor,代碼行數:7,代碼來源:testEuclideanDivision.py

示例5: test_self_litteral_self_litteral_euclideandivision_with_non_empty_evaluation

# 需要導入模塊: from arithmeticExpressions import EuclideanDivision [as 別名]
# 或者: from arithmeticExpressions.EuclideanDivision import value [as 別名]
 def test_self_litteral_self_litteral_euclideandivision_with_non_empty_evaluation(self):
     a1 = SelfLitteral()
     a2 = SelfLitteral()
     expr = EuclideanDivision(a1, a2)
     self.assertEqual(expr.value(self.eval2, 1), 1)
開發者ID:mouton5000,項目名稱:DiscreteEventApplicationEditor,代碼行數:7,代碼來源:testEuclideanDivision.py

示例6: test_bad_float_euclideandivision_with_non_empty_evaluation

# 需要導入模塊: from arithmeticExpressions import EuclideanDivision [as 別名]
# 或者: from arithmeticExpressions.EuclideanDivision import value [as 別名]
 def test_bad_float_euclideandivision_with_non_empty_evaluation(self):
     a1 = ALitteral(pi)
     a2 = ALitteral(0.0)
     expr = EuclideanDivision(a1, a2)
     with self.assertRaises(ArithmeticError):
         expr.value(self.eval2)
開發者ID:mouton5000,項目名稱:DiscreteEventApplicationEditor,代碼行數:8,代碼來源:testEuclideanDivision.py

示例7: test_undefined_integer_euclideandivision_with_empty_evaluation

# 需要導入模塊: from arithmeticExpressions import EuclideanDivision [as 別名]
# 或者: from arithmeticExpressions.EuclideanDivision import value [as 別名]
 def test_undefined_integer_euclideandivision_with_empty_evaluation(self):
     a1 = UndefinedLitteral()
     a2 = ALitteral(20)
     expr = EuclideanDivision(a1, a2)
     with self.assertRaises(TypeError):
         expr.value(self.eval1)
開發者ID:mouton5000,項目名稱:DiscreteEventApplicationEditor,代碼行數:8,代碼來源:testEuclideanDivision.py

示例8: test_evaluated_variable_float_euclideandivision

# 需要導入模塊: from arithmeticExpressions import EuclideanDivision [as 別名]
# 或者: from arithmeticExpressions.EuclideanDivision import value [as 別名]
 def test_evaluated_variable_float_euclideandivision(self):
     a1 = ALitteral(Variable('X'))
     a2 = ALitteral(sqrt(2))
     expr = EuclideanDivision(a1, a2)
     self.assertEqual(expr.value(self.eval2), 0)
開發者ID:mouton5000,項目名稱:DiscreteEventApplicationEditor,代碼行數:7,代碼來源:testEuclideanDivision.py

示例9: test_bad_integer_euclideandivision_with_empty_evaluation

# 需要導入模塊: from arithmeticExpressions import EuclideanDivision [as 別名]
# 或者: from arithmeticExpressions.EuclideanDivision import value [as 別名]
 def test_bad_integer_euclideandivision_with_empty_evaluation(self):
     a1 = ALitteral(10)
     a2 = ALitteral(0)
     expr = EuclideanDivision(a1, a2)
     with self.assertRaises(ArithmeticError):
         expr.value(self.eval1)
開發者ID:mouton5000,項目名稱:DiscreteEventApplicationEditor,代碼行數:8,代碼來源:testEuclideanDivision.py

示例10: test_evaluated_variable_string_euclideandivision

# 需要導入模塊: from arithmeticExpressions import EuclideanDivision [as 別名]
# 或者: from arithmeticExpressions.EuclideanDivision import value [as 別名]
 def test_evaluated_variable_string_euclideandivision(self):
     a1 = ALitteral(Variable('X'))
     a2 = ALitteral('def')
     expr = EuclideanDivision(a1, a2)
     with self.assertRaises(TypeError):
         expr.value(self.eval2)
開發者ID:mouton5000,項目名稱:DiscreteEventApplicationEditor,代碼行數:8,代碼來源:testEuclideanDivision.py

示例11: test_integers_euclideandivision_with_non_empty_evaluation

# 需要導入模塊: from arithmeticExpressions import EuclideanDivision [as 別名]
# 或者: from arithmeticExpressions.EuclideanDivision import value [as 別名]
 def test_integers_euclideandivision_with_non_empty_evaluation(self):
     a1 = ALitteral(10)
     a2 = ALitteral(20)
     expr = EuclideanDivision(a1, a2)
     self.assertEqual(expr.value(self.eval2), 0)
開發者ID:mouton5000,項目名稱:DiscreteEventApplicationEditor,代碼行數:7,代碼來源:testEuclideanDivision.py

示例12: test_integer_evaluated_variable_euclideandivision

# 需要導入模塊: from arithmeticExpressions import EuclideanDivision [as 別名]
# 或者: from arithmeticExpressions.EuclideanDivision import value [as 別名]
 def test_integer_evaluated_variable_euclideandivision(self):
     a1 = ALitteral(10)
     a2 = ALitteral(Variable('X'))
     expr = EuclideanDivision(a1, a2)
     self.assertEqual(expr.value(self.eval2), 10)
開發者ID:mouton5000,項目名稱:DiscreteEventApplicationEditor,代碼行數:7,代碼來源:testEuclideanDivision.py

示例13: test_undefined_float_euclideandivision_with_non_empty_evaluation

# 需要導入模塊: from arithmeticExpressions import EuclideanDivision [as 別名]
# 或者: from arithmeticExpressions.EuclideanDivision import value [as 別名]
 def test_undefined_float_euclideandivision_with_non_empty_evaluation(self):
     a1 = UndefinedLitteral()
     a2 = ALitteral(sqrt(2))
     expr = EuclideanDivision(a1, a2)
     with self.assertRaises(TypeError):
         expr.value(self.eval2)
開發者ID:mouton5000,項目名稱:DiscreteEventApplicationEditor,代碼行數:8,代碼來源:testEuclideanDivision.py

示例14: test_string_undefined_euclideandivision_with_non_empty_evaluation

# 需要導入模塊: from arithmeticExpressions import EuclideanDivision [as 別名]
# 或者: from arithmeticExpressions.EuclideanDivision import value [as 別名]
 def test_string_undefined_euclideandivision_with_non_empty_evaluation(self):
     a1 = ALitteral('abc')
     a2 = UndefinedLitteral()
     expr = EuclideanDivision(a1, a2)
     with self.assertRaises(TypeError):
         expr.value(self.eval2)
開發者ID:mouton5000,項目名稱:DiscreteEventApplicationEditor,代碼行數:8,代碼來源:testEuclideanDivision.py

示例15: test_unevaluated_variable_self_litteral_euclideandivision

# 需要導入模塊: from arithmeticExpressions import EuclideanDivision [as 別名]
# 或者: from arithmeticExpressions.EuclideanDivision import value [as 別名]
 def test_unevaluated_variable_self_litteral_euclideandivision(self):
     a1 = ALitteral(Variable('Y'))
     a2 = SelfLitteral()
     expr = EuclideanDivision(a1, a2)
     with self.assertRaises(ValueError):
         expr.value(self.eval2, 1)
開發者ID:mouton5000,項目名稱:DiscreteEventApplicationEditor,代碼行數:8,代碼來源:testEuclideanDivision.py


注:本文中的arithmeticExpressions.EuclideanDivision.value方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。