title: Why does math.infinity turn to a big negative integer when overwriting in some cases?
body: <p>I want to overwrite some array values for a min-finding algorithm.
  For these examples, I want the values of the first row to be replaced by <code>math.inf</code>.</p>
  <p>It works fine in example <code>c</code>, but I don't understand what happens in <code>a</code> and <code>b</code>:</p>
  <pre><code>import numpy as np
  import math
  
  a = np.repeat(0, 9).reshape((3, 3))
  a[0, :] = np.ones((3,)) * math.inf
  print(a)
  
  b = np.arange(9).reshape((3, 3))
  b[0, :] = np.ones((3,)) * math.inf
  print(b)
  
  c = np.empty((3, 3))
  c[0, :] = np.ones((3,)) * math.inf
  print(c)
  </code></pre>
  <p>Output: shows infinity as the row entry in example <code>c</code>, but <code>-9223372036854775808</code> in example <code>a</code> and <code>b</code>.</p>
  <p><a href="https://i.stack.imgur.com/wx15L.png" rel="noreferrer"><img src="https://i.stack.imgur.com/wx15L.png" alt="enter image description here" /></a></p>
  <p>Why does the existing output have an influence when I overwrite it?</p>