Beispiel #1
0
 def _():
     assert mf.divide([[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12],
                       [13, 14, 15, 16]],
                      [[1, -2, 1, 2], [2, 2, -1, 1], [1, 2, 1, -1],
                       [2, 1, 1, -1]]) == [[1.0, -1.0, 3.0, 2.0],
                                           [2.5, 3.0, -7.0, 8.0],
                                           [9.0, 5.0, 11.0, -12.0],
                                           [6.5, 14.0, 15.0, -16.0]]
Beispiel #2
0
 def _():
     assert mf.divide(
         [[1, 2, 3, 4, 5], [6, 7, 8, 9, 10.1], [11, 12, 13, 14, 15],
          [1.6, 17, 13, 19, 20], [21, -22, 23, 24, 25]],
         [[1, 2, 2, -2, 2], [1, -2, -1, 2, 2], [-2, 1, 1, -2, 1],
          [-1, 2, 1, -1, -2], [-1, 2, 2, -1, -2]]) == [
              [1.0, 1.0, 1.5, -2.0, 2.5], [6.0, -3.5, -8.0, 4.5, 5.05],
              [-5.5, 12.0, 13.0, -7.0, 15.0],
              [-1.6, 8.5, 13.0, -19.0, -10.0],
              [-21.0, -11.0, 11.5, -24.0, -12.5]
          ]
Beispiel #3
0
 def _():
     assert mf.divide([[3, 2], [3, 4]],
                      [[2, 2], [-4, -1]]) == [[1.5, 1], [-0.75, -4]]
Beispiel #4
0
 def _():
     assert mf.divide(
         [[1, 2, 3], [4, 5, 6], [7, 8, 9]],
         [[2, 1, 1], [-1, -2, 1], [2, -2, 2]]) == [[0.5, 2.0, 3.0],
                                                   [-4.0, -2.5, 6.0],
                                                   [3.5, -4.0, 4.5]]
Beispiel #5
0
 def _():
     mf.divide([], [])