# \-0f

**URL:** <https://forum.kx.com/t/0f/12090>\
**Category:** Community Support\
**Tags:** kdb-and-q\
**Created:** [November 23, 2020, 10:35am UTC](https://forum.kx.com/t/0f/12090 "2020-11-23T10:35:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gshyam](https://avatars.discourse-cdn.com/v4/letter/g/97f17d/32.png) [@gshyam](https://forum.kx.com/u/gshyam)\
**Post date:** [November 23, 2020, 10:35am UTC](https://forum.kx.com/t/0f/12090/1 "2020-11-23T10:35:00Z")

</div>

Hello All!

I am new to this forum and this is my first question here.

I have been using kdb to develop solutions for my company for about 8 months now.

I have a rather simple question:

q)a:-3i

q)b:0f

q)a\*b  
-0f

I dont want to see the -0.&nbsp;

Note that b can be non zero (for example 3), so simply taking the absolute value would not serve my purpose (taking abs would give output as 9, but i want to see -9).

Any help is much appreciated! Thanks a lot.

Giridhar

CONFIDENTIALITY NOTICE: This e-mail and any attachments are for the exclusive   
and confidential use of the recipient(s) who we intend for institutional   
customers as opposed to retail customers and may constitute non-public information.  
If you received this e-mail in error, disclosing, copying, distributing or taking   
any action in reliance of this e-mail is strictly prohibited and may be unlawful.  
Instead, please notify us immediately by return e-mail and promptly delete this   
message and its attachments from your computer system as we do not waive any work   
product or other applicable legal privilege(s) by the transmission of this message.   
NOTE: The information in this e-mail does not constitute tradingadvice.

---

<div class="post-metadata">

**Author:** ![TerryLynch1](https://avatars.discourse-cdn.com/v4/letter/t/9e8a1a/32.png) [@TerryLynch1](https://forum.kx.com/u/TerryLynch1)\
**Post date:** [November 23, 2020, 10:47am UTC](https://forum.kx.com/t/0f/12090/2 "2020-11-23T10:47:00Z")

</div>

This might work for you

q){signum_abs x}a_b

0f

Terry

---

<div class="post-metadata">

**Author:** ![gshyam](https://avatars.discourse-cdn.com/v4/letter/g/97f17d/32.png) [@gshyam](https://forum.kx.com/u/gshyam)\
**Post date:** [November 23, 2020, 11:29am UTC](https://forum.kx.com/t/0f/12090/3 "2020-11-23T11:29:00Z")

</div>

Thanks a lot @TerryLynch

I found another solution by chance:

q)0f+a\*b

0f

Just adding 0f seems to work. I don’t have an explanation for this behaviour, but for cleanliness of code I am going with this…

Do you know why this works?

---

<div class="post-metadata">

**Author:** ![TerryLynch1](https://avatars.discourse-cdn.com/v4/letter/t/9e8a1a/32.png) [@TerryLynch1](https://forum.kx.com/u/TerryLynch1)\
**Post date:** [November 23, 2020, 12:30pm UTC](https://forum.kx.com/t/0f/12090/4 "2020-11-23T12:30:00Z")

</div>

Oh nice! Yeah that is cleaner. I don’t know why it works per se, other than that its clear that kdb resolves 0f plus -0f to be 0f. Possibly some edge case logic.

---

<div class="post-metadata">

**Author:** ![charlie1](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@charlie1](https://forum.kx.com/u/charlie1)\
**Post date:** [November 23, 2020, 1:22pm UTC](https://forum.kx.com/t/0f/12090/5 "2020-11-23T13:22:00Z")

</div>

https://en.wikipedia.org/wiki/Signed\_zero#Arithmetic

---

<div class="post-metadata">

**Author:** ![gshyam](https://avatars.discourse-cdn.com/v4/letter/g/97f17d/32.png) [@gshyam](https://forum.kx.com/u/gshyam)\
**Post date:** [November 23, 2020, 1:40pm UTC](https://forum.kx.com/t/0f/12090/6 "2020-11-23T13:40:00Z")

</div>

This is very helpful. Thanks a lot @Charles Skelton
