How to do numpy's dtype?

Oct 30, 2017 at 2:48pm
From what I've seen floats and doubles have different levels of precision based on what computer you run/compile it on. I've also seen numpy's dtype. An example might be
 
np.empty([4, 2], dtype='float32')

I know it uses C/C++ natives so how do you say in C++
 
float32 a = 3.5f;

?
Last edited on Oct 30, 2017 at 2:48pm
Oct 30, 2017 at 3:23pm
??

1.
NumPy supports a much greater variety of numerical types than Python does.



2. http://en.cppreference.com/w/cpp/language/types
... says that while integer types do vary, the floating point types usually follow IEEE-754z
Oct 30, 2017 at 3:50pm
I also meant things like float16. How does numpy achieve that? Also, I'm not concerned with Python but C.
Oct 30, 2017 at 5:00pm
Numpy is open source, is it not? Therefore, you can download and read the code.
Topic archived. No new replies allowed.