<p dir="auto">I'll log this for now:</p>
<p dir="auto">on ubuntu 16.04.2<br>
numpy 1.13.1 installed fine on python 3.6.2.rc1<br>
numpy 1.13.0 installed fine on python 3.7.0a0 (heads/master:6969eaf)</p>
<p dir="auto">Numpy 1.13.1 failure in building:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="     building 'numpy.random.mtrand' extension
    compiling C sources
    C compiler: gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC
    
    creating build/temp.linux-x86_64-3.7/numpy/random
    creating build/temp.linux-x86_64-3.7/numpy/random/mtrand
    compile options: '-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -Inumpy/core/include -Ibuild/src.linux-x86_64-3.7/numpy/core/include/numpy -Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/local/include/python3.7m -Ibuild/src.linux-x86_64-3.7/numpy/core/src/private -Ibuild/src.linux-x86_64-3.7/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.7/numpy/core/src/private -Ibuild/src.linux-x86_64-3.7/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.7/numpy/core/src/private -Ibuild/src.linux-x86_64-3.7/numpy/core/src/npymath -c'
    gcc: numpy/random/mtrand/mtrand.c
    numpy/random/mtrand/mtrand.c: In function ‘__Pyx_PyCFunction_FastCall’:
    numpy/random/mtrand/mtrand.c:44374:12: error: too many arguments to function ‘(PyObject * (*)(PyObject *, PyObject **, Py_ssize_t))meth’
         return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
                ^
    numpy/random/mtrand/mtrand.c: In function ‘__Pyx_PyCFunction_FastCall’:
    numpy/random/mtrand/mtrand.c:44374:12: error: too many arguments to function ‘(PyObject * (*)(PyObject *, PyObject **, Py_ssize_t))meth’
         return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
                ^
    error: Command &quot;gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -Inumpy/core/include -Ibuild/src.linux-x86_64-3.7/numpy/core/include/numpy -Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/local/include/python3.7m -Ibuild/src.linux-x86_64-3.7/numpy/core/src/private -Ibuild/src.linux-x86_64-3.7/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.7/numpy/core/src/private -Ibuild/src.linux-x86_64-3.7/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.7/numpy/core/src/private -Ibuild/src.linux-x86_64-3.7/numpy/core/src/npymath -c numpy/random/mtrand/mtrand.c -o build/temp.linux-x86_64-3.7/numpy/random/mtrand/mtrand.o -MMD -MF build/temp.linux-x86_64-3.7/numpy/random/mtrand/mtrand.o.d&quot; failed with exit status 1
    
    ----------------------------------------
  Rolling back uninstall of numpy"><pre class="notranslate"><code class="notranslate">     building 'numpy.random.mtrand' extension
    compiling C sources
    C compiler: gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC
    
    creating build/temp.linux-x86_64-3.7/numpy/random
    creating build/temp.linux-x86_64-3.7/numpy/random/mtrand
    compile options: '-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -Inumpy/core/include -Ibuild/src.linux-x86_64-3.7/numpy/core/include/numpy -Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/local/include/python3.7m -Ibuild/src.linux-x86_64-3.7/numpy/core/src/private -Ibuild/src.linux-x86_64-3.7/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.7/numpy/core/src/private -Ibuild/src.linux-x86_64-3.7/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.7/numpy/core/src/private -Ibuild/src.linux-x86_64-3.7/numpy/core/src/npymath -c'
    gcc: numpy/random/mtrand/mtrand.c
    numpy/random/mtrand/mtrand.c: In function ‘__Pyx_PyCFunction_FastCall’:
    numpy/random/mtrand/mtrand.c:44374:12: error: too many arguments to function ‘(PyObject * (*)(PyObject *, PyObject **, Py_ssize_t))meth’
         return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
                ^
    numpy/random/mtrand/mtrand.c: In function ‘__Pyx_PyCFunction_FastCall’:
    numpy/random/mtrand/mtrand.c:44374:12: error: too many arguments to function ‘(PyObject * (*)(PyObject *, PyObject **, Py_ssize_t))meth’
         return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
                ^
    error: Command "gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -Inumpy/core/include -Ibuild/src.linux-x86_64-3.7/numpy/core/include/numpy -Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/usr/local/include/python3.7m -Ibuild/src.linux-x86_64-3.7/numpy/core/src/private -Ibuild/src.linux-x86_64-3.7/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.7/numpy/core/src/private -Ibuild/src.linux-x86_64-3.7/numpy/core/src/npymath -Ibuild/src.linux-x86_64-3.7/numpy/core/src/private -Ibuild/src.linux-x86_64-3.7/numpy/core/src/npymath -c numpy/random/mtrand/mtrand.c -o build/temp.linux-x86_64-3.7/numpy/random/mtrand/mtrand.o -MMD -MF build/temp.linux-x86_64-3.7/numpy/random/mtrand/mtrand.o.d" failed with exit status 1
    
    ----------------------------------------
  Rolling back uninstall of numpy
</code></pre></div>
<p dir="auto">When i use a float32 dtype array as the argument to numpy.fft.rfft, I get a complex128 dtype array as the output instead of a complex64 dtype array.<br>
Similarly, when I use a complex64 dtype array as the argument to numpy.fft.irfft, I get a float64 dtype array instead of a float32 dtype array.<br>
Here is a code snippet :</p>
<p dir="auto">In [4]: a = np.array([1., 2., 3.], dtype=np.float32)<br>
In [5]: a<br>
Out[5]: array([ 1.,  2.,  3.], dtype=float32)<br>
In [6]: b = np.fft.rfft(a)<br>
In [7]: b<br>
Out[7]: array([ 6.0+0.j       , -1.5+0.8660254j])<br>
In [8]: b.dtype<br>
Out[8]: dtype('complex128')<br>
In [9]: b.astype(np.complex64)<br>
Out[9]: array([ 6.0+0.j        , -1.5+0.86602539j], dtype=complex64)<br>
In [10]: c = np.fft.irfft(b)<br>
In [11]: c<br>
Out[11]: array([ 2.25,  3.75])<br>
In [12]: c.dtype<br>
Out[12]: dtype('float64')</p>