# Aerospike function not working properly

**URL:** <https://discuss.aerospike.com/t/aerospike-function-not-working-properly/6069>\
**Category:** C Client Library\
**Created:** [March 27, 2019, 9:14am UTC](https://discuss.aerospike.com/t/aerospike-function-not-working-properly/6069 "2019-03-27T09:14:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arpit\_Maiya](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/arpit_maiya/32/1105_2.png) [@Arpit\_Maiya](https://discuss.aerospike.com/u/Arpit_Maiya)\
**Post date:** [March 27, 2019, 9:14am UTC](https://discuss.aerospike.com/t/aerospike-function-not-working-properly/6069/1 "2019-03-27T09:14:10Z")

</div>

```auto
+--------------------+

| key4 |

+--------------------+

| 0.8999999999999999 |

+--------------------+

as_operations_add_incr_double()

```

The above function is having a incrementing the float value in wrong manner, when used for some time. Example, when I am adding 0.3 to bin using the above function, for first time it works properly, but when I use it 3rd time, it should put 0.9 in the bin, but it is adding something which is rounding off to the above value. Please help.

---

<div class="post-metadata">

**Author:** ![kporter](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/kporter/32/515_2.png) [@kporter](https://discuss.aerospike.com/u/kporter)\
**Post date:** [March 27, 2019, 4:15pm UTC](https://discuss.aerospike.com/t/aerospike-function-not-working-properly/6069/2 "2019-03-27T16:15:11Z")

</div>

This is how floating point arithmetic is expected to work.

> **[The Floating-Point Guide - Basic Answers](https://floating-point-gui.de/basic/)**
>
> Concise answers to common basic questions about floating-point math, like

---

<div class="post-metadata">

**Author:** ![Arpit\_Maiya](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/arpit_maiya/32/1105_2.png) [@Arpit\_Maiya](https://discuss.aerospike.com/u/Arpit_Maiya)\
**Post date:** [March 28, 2019, 5:30am UTC](https://discuss.aerospike.com/t/aerospike-function-not-working-properly/6069/3 "2019-03-28T05:30:57Z")

</div>

Thanks Kevin for the help.

---

<div class="post-metadata">

**Author:** ![system](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.aerospike.com/system/32/2274_2.png) [@system](https://discuss.aerospike.com/u/system)\
**Post date:** [April 15, 2019, 10:55am UTC](https://discuss.aerospike.com/t/aerospike-function-not-working-properly/6069/4 "2019-04-15T10:55:02Z")

</div>

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.
