# abs() returns negative value? why?

**URL:** https://discourse.paraview.org/t/abs-returns-negative-value-why/355
**Category:** ParaView Support
**Created:** [July 25, 2018, 5:48am UTC](https://discourse.paraview.org/t/abs-returns-negative-value-why/355 "2018-07-25T05:48:57Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Someone\_fromjapan](https://discourse.paraview.org/user_avatar/discourse.paraview.org/someone_fromjapan/32/2892_2.png) [@Someone\_fromjapan](https://discourse.paraview.org/u/Someone_fromjapan)
#### Post date: [July 25, 2018, 5:48am UTC](https://discourse.paraview.org/t/abs-returns-negative-value-why/355/1 "2018-07-25T05:48:58Z")

</div>

Can you please tell me what is wrong in the image below?

 ![image](https://discourse.paraview.org/uploads/default/original/1X/b70910d210886cd5bc7ee1db39ba4d5ab731e3da.png)

I just don’t see how abs() from a scalar can return a negative value?

---

<div class="post-metadata">

### Author: ![Kenneth\_Moreland](https://discourse.paraview.org/user_avatar/discourse.paraview.org/kenneth_moreland/32/15033_2.png) [@Kenneth\_Moreland](https://discourse.paraview.org/u/Kenneth_Moreland)
#### Post date: [July 25, 2018, 6:45am UTC](https://discourse.paraview.org/t/abs-returns-negative-value-why/355/2 "2018-07-25T06:45:08Z")

</div>

You are probably taking the `log10` of 0. Taking the log of 0 is equally invalid.

Understandably, the error message is confusing. I raised a bug report for that: [https://gitlab.kitware.com/paraview/paraview/issues/18322](https://gitlab.kitware.com/paraview/paraview/issues/18322)

---

<div class="post-metadata">

### Author: ![Someone\_fromjapan](https://discourse.paraview.org/user_avatar/discourse.paraview.org/someone_fromjapan/32/2892_2.png) [@Someone\_fromjapan](https://discourse.paraview.org/u/Someone_fromjapan)
#### Post date: [July 25, 2018, 7:31am UTC](https://discourse.paraview.org/t/abs-returns-negative-value-why/355/3 "2018-07-25T07:31:28Z")

</div>

Ah, so switching “replace invalid results” mode should produce more or less adequate effect?  
That’s all right. Thank you for responding so promptly!

---

<div class="post-metadata">

### Author: ![Kenneth\_Moreland](https://discourse.paraview.org/user_avatar/discourse.paraview.org/kenneth_moreland/32/15033_2.png) [@Kenneth\_Moreland](https://discourse.paraview.org/u/Kenneth_Moreland)
#### Post date: [July 25, 2018, 12:04pm UTC](https://discourse.paraview.org/t/abs-returns-negative-value-why/355/4 "2018-07-25T12:04:47Z")

</div>

Yes, that seemed to work for me. But you might consider also changing the `Replacement Value` field from 0 to some low negative number. Remember that log of a number less than 1 (but greater than 0) is negative, so it would be best that whatever the calculator replaces 0’s with is less than other expected values.
