Open
Description
Hello! Very excited about this library, as it (hopefully) provides a place to put functions that are array agnostic and usable by many people. Let me describe two simple ones that I'd like to make a PR for.
I'd like to add functions real_type(dtype)
and complex_type(dtype)
. These are simple:
real_type
takes in a real or complex dtype, and returns the corresponding floating-point dtype. Socomplex128 -> float64, complex64 -> float32, float64 -> float64, float32 -> float32
.complex_type
takes in a real or complex dtype, and returns the corresponding complex floating-point dtype. Sofloat64 -> complex128, float32 -> complex64, complex128 -> complex128, complex64 -> complex64
.
This can be really helpful in application code to work out the correct types. Shall I make a PR for these?