# Reduction of accuracy

**URL:** <https://community.konduit.ai/t/reduction-of-accuracy/786>\
**Category:** ND4J\
**Created:** [August 13, 2020, 3:09pm UTC](https://community.konduit.ai/t/reduction-of-accuracy/786 "2020-08-13T15:09:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![amirshamaei](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/amirshamaei/32/100_2.png) [@amirshamaei](https://community.konduit.ai/u/amirshamaei)\
**Post date:** [August 13, 2020, 3:09pm UTC](https://community.konduit.ai/t/reduction-of-accuracy/786/1 "2020-08-13T15:09:14Z")

</div>

Hi all,  
I have an array namely “real”. it has a vector of double numbers. I am trying to create an INDArray based on my vector.  
my code is below :

```
double real_d = (double) ArrBD.get(0);
INDArray real = Nd4j.create(real_d);

```

It works but unfortunately, it converts big numbers to infinity and small numbers to zero.  
Here you can see the double array:

> [0.0, 5.911259568298103E-306, -1.8401529637727614E-221, 1.7562463582928743E-268, 2.7206514809021945E-133, 4.583815262762733E90, 2.5637698710586 …

and here the data of INDArray:

> [0.0,0.0,-0.0,0.0,0.0,Infinity,Infinity,-0.0,-0.0 …

I appreciate your help in advance

---

<div class="post-metadata">

**Author:** ![cagneymoreau](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/cagneymoreau/32/296_2.png) [@cagneymoreau](https://community.konduit.ai/u/cagneymoreau)\
**Post date:** [August 13, 2020, 9:59pm UTC](https://community.konduit.ai/t/reduction-of-accuracy/786/2 "2020-08-13T21:59:56Z")

</div>

correct me if im wrong but your loosing precision? each number is only allowed so much accuracy because of its memory size? is this what you mean?

---

<div class="post-metadata">

**Author:** ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)\
**Post date:** [August 14, 2020, 4:22am UTC](https://community.konduit.ai/t/reduction-of-accuracy/786/3 "2020-08-14T04:22:05Z")

</div>

This is likely due to not specifying the data type. We don’t implement a “double” etc any different way than what you’d see in numpy etc.

---

<div class="post-metadata">

**Author:** ![amirshamaei](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/amirshamaei/32/100_2.png) [@amirshamaei](https://community.konduit.ai/u/amirshamaei)\
**Post date:** [August 14, 2020, 7:09am UTC](https://community.konduit.ai/t/reduction-of-accuracy/786/4 "2020-08-14T07:09:41Z")

</div>

Thank you. You are right. I understood what is going behind it. I read binary file in double format and Nd4j shows it in float format during debugging, but when I call this line

> data.real.data().asDouble();

it returns correct values.
