当前位置: 首页>>代码示例>>Python>>正文


Python Subtraction.value方法代码示例

本文整理汇总了Python中arithmeticExpressions.Subtraction.value方法的典型用法代码示例。如果您正苦于以下问题:Python Subtraction.value方法的具体用法?Python Subtraction.value怎么用?Python Subtraction.value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在arithmeticExpressions.Subtraction的用法示例。


在下文中一共展示了Subtraction.value方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_self_litteral_float_subtraction_with_empty_evaluation

# 需要导入模块: from arithmeticExpressions import Subtraction [as 别名]
# 或者: from arithmeticExpressions.Subtraction import value [as 别名]
 def test_self_litteral_float_subtraction_with_empty_evaluation(self):
     a1 = SelfLitteral()
     a2 = ALitteral(sqrt(2))
     expr = Subtraction(a1, a2)
     self.assertEqual(expr.value(self.eval1, 1), 1 - sqrt(2))
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:7,代码来源:testSubtraction.py

示例2: test_self_litteral_string_subtraction_with_non_empty_evaluation

# 需要导入模块: from arithmeticExpressions import Subtraction [as 别名]
# 或者: from arithmeticExpressions.Subtraction import value [as 别名]
 def test_self_litteral_string_subtraction_with_non_empty_evaluation(self):
     a1 = SelfLitteral()
     a2 = ALitteral('def')
     expr = Subtraction(a1, a2)
     with self.assertRaises(TypeError):
         expr.value(self.eval2, 1)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:8,代码来源:testSubtraction.py

示例3: test_float_self_litteral_subtraction_with_empty_evaluation

# 需要导入模块: from arithmeticExpressions import Subtraction [as 别名]
# 或者: from arithmeticExpressions.Subtraction import value [as 别名]
 def test_float_self_litteral_subtraction_with_empty_evaluation(self):
     a1 = ALitteral(pi)
     a2 = SelfLitteral()
     expr = Subtraction(a1, a2)
     self.assertEqual(expr.value(self.eval1, 1), pi - 1)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:7,代码来源:testSubtraction.py

示例4: test_string_integer_subtraction_with_non_empty_evaluation

# 需要导入模块: from arithmeticExpressions import Subtraction [as 别名]
# 或者: from arithmeticExpressions.Subtraction import value [as 别名]
 def test_string_integer_subtraction_with_non_empty_evaluation(self):
     a1 = ALitteral('abc')
     a2 = ALitteral(20)
     expr = Subtraction(a1, a2)
     with self.assertRaises(TypeError):
         expr.value(self.eval2)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:8,代码来源:testSubtraction.py

示例5: test_string_float_subtraction_with_empty_evaluation

# 需要导入模块: from arithmeticExpressions import Subtraction [as 别名]
# 或者: from arithmeticExpressions.Subtraction import value [as 别名]
 def test_string_float_subtraction_with_empty_evaluation(self):
     a1 = ALitteral('abc')
     a2 = ALitteral(sqrt(2))
     expr = Subtraction(a1, a2)
     with self.assertRaises(TypeError):
         expr.value(self.eval1)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:8,代码来源:testSubtraction.py

示例6: test_evaluated_variable_self_litteral_subtraction

# 需要导入模块: from arithmeticExpressions import Subtraction [as 别名]
# 或者: from arithmeticExpressions.Subtraction import value [as 别名]
 def test_evaluated_variable_self_litteral_subtraction(self):
     a1 = SelfLitteral()
     a2 = ALitteral(Variable('X'))
     expr = Subtraction(a1, a2)
     self.assertEqual(expr.value(self.eval2, 2), 1)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:7,代码来源:testSubtraction.py

示例7: test_floats_subtraction_with_non_empty_evaluation

# 需要导入模块: from arithmeticExpressions import Subtraction [as 别名]
# 或者: from arithmeticExpressions.Subtraction import value [as 别名]
 def test_floats_subtraction_with_non_empty_evaluation(self):
     a1 = ALitteral(pi)
     a2 = ALitteral(sqrt(2))
     expr = Subtraction(a1, a2)
     self.assertEqual(expr.value(self.eval2), pi - sqrt(2))
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:7,代码来源:testSubtraction.py

示例8: test_evaluated_variable_float_subtraction

# 需要导入模块: from arithmeticExpressions import Subtraction [as 别名]
# 或者: from arithmeticExpressions.Subtraction import value [as 别名]
 def test_evaluated_variable_float_subtraction(self):
     a1 = ALitteral(Variable('X'))
     a2 = ALitteral(sqrt(2))
     expr = Subtraction(a1, a2)
     self.assertEqual(expr.value(self.eval2), 1 - sqrt(2))
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:7,代码来源:testSubtraction.py

示例9: test_evaluated_variable_undefined_subtraction

# 需要导入模块: from arithmeticExpressions import Subtraction [as 别名]
# 或者: from arithmeticExpressions.Subtraction import value [as 别名]
 def test_evaluated_variable_undefined_subtraction(self):
     a1 = ALitteral(Variable('X'))
     a2 = UndefinedLitteral()
     expr = Subtraction(a1, a2)
     with self.assertRaises(TypeError):
         expr.value(self.eval2), 0
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:8,代码来源:testSubtraction.py

示例10: test_evaluated_variable_integer_subtraction

# 需要导入模块: from arithmeticExpressions import Subtraction [as 别名]
# 或者: from arithmeticExpressions.Subtraction import value [as 别名]
 def test_evaluated_variable_integer_subtraction(self):
     a1 = ALitteral(Variable('X'))
     a2 = ALitteral(20)
     expr = Subtraction(a1, a2)
     self.assertEqual(expr.value(self.eval2), -19)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:7,代码来源:testSubtraction.py

示例11: test_evaluated_variable_string_subtraction

# 需要导入模块: from arithmeticExpressions import Subtraction [as 别名]
# 或者: from arithmeticExpressions.Subtraction import value [as 别名]
 def test_evaluated_variable_string_subtraction(self):
     a1 = ALitteral(Variable('X'))
     a2 = ALitteral('def')
     expr = Subtraction(a1, a2)
     with self.assertRaises(TypeError):
         expr.value(self.eval2)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:8,代码来源:testSubtraction.py

示例12: test_undefined_float_subtraction_with_non_empty_evaluation

# 需要导入模块: from arithmeticExpressions import Subtraction [as 别名]
# 或者: from arithmeticExpressions.Subtraction import value [as 别名]
 def test_undefined_float_subtraction_with_non_empty_evaluation(self):
     a1 = UndefinedLitteral()
     a2 = ALitteral(sqrt(2))
     expr = Subtraction(a1, a2)
     with self.assertRaises(TypeError):
         expr.value(self.eval2)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:8,代码来源:testSubtraction.py

示例13: test_float_undefined_subtraction_with_empty_evaluation

# 需要导入模块: from arithmeticExpressions import Subtraction [as 别名]
# 或者: from arithmeticExpressions.Subtraction import value [as 别名]
 def test_float_undefined_subtraction_with_empty_evaluation(self):
     a1 = ALitteral(pi)
     a2 = UndefinedLitteral()
     expr = Subtraction(a1, a2)
     with self.assertRaises(TypeError):
         expr.value(self.eval1)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:8,代码来源:testSubtraction.py

示例14: test_integer_undefined_subtraction_with_non_empty_evaluation

# 需要导入模块: from arithmeticExpressions import Subtraction [as 别名]
# 或者: from arithmeticExpressions.Subtraction import value [as 别名]
 def test_integer_undefined_subtraction_with_non_empty_evaluation(self):
     a1 = ALitteral(10)
     a2 = UndefinedLitteral()
     expr = Subtraction(a1, a2)
     with self.assertRaises(TypeError):
         expr.value(self.eval2)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:8,代码来源:testSubtraction.py

示例15: test_self_litteral_self_litteral_subtraction_with_non_empty_evaluation

# 需要导入模块: from arithmeticExpressions import Subtraction [as 别名]
# 或者: from arithmeticExpressions.Subtraction import value [as 别名]
 def test_self_litteral_self_litteral_subtraction_with_non_empty_evaluation(self):
     a1 = SelfLitteral()
     a2 = SelfLitteral()
     expr = Subtraction(a1, a2)
     self.assertEqual(expr.value(self.eval2, 1), 0)
开发者ID:mouton5000,项目名称:DiscreteEventApplicationEditor,代码行数:7,代码来源:testSubtraction.py


注:本文中的arithmeticExpressions.Subtraction.value方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。