# \[F\] Two $num failures

**URL:** https://community.mp3tag.de/t/f-two-num-failures/5734
**Category:** Fixed Bugs
**Tags:** bug-fixed
**Created:** [November 14, 2007, 1:53pm UTC](https://community.mp3tag.de/t/f-two-num-failures/5734 "2007-11-14T13:53:20Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [November 14, 2007, 1:53pm UTC](https://community.mp3tag.de/t/f-two-num-failures/5734/1 "2007-11-14T13:53:20Z")

</div>

1. $num fails with numbers that though large are within script arithmetic range e.g.

Pad UPC 043011001826 to EAN: 2147483647 (expected 0043011001826)  
Compute 043011001826+1: 43011001827 (expected 43011001827 and got same)

1. $num fails when asked for more than five digits e.g.

Pad catalogue number to six places: 01826 (expected 001826).

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [November 15, 2007, 7:49pm UTC](https://community.mp3tag.de/t/f-two-num-failures/5734/2 "2007-11-15T19:49:29Z")

</div>

The $num function is limited to 5 digits. I'll update the documentation.

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [November 15, 2007, 7:56pm UTC](https://community.mp3tag.de/t/f-two-num-failures/5734/3 "2007-11-15T19:56:00Z")

</div>

Thanks. But note that even with five digits it can fail e.g. $num(3011001826,5) -\> 2147483647 .

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [November 15, 2007, 8:00pm UTC](https://community.mp3tag.de/t/f-two-num-failures/5734/4 "2007-11-15T20:00:06Z")

</div>

This is the upper limit of the int data type. Maybe I can use 64 bit ints.

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [November 15, 2007, 8:16pm UTC](https://community.mp3tag.de/t/f-two-num-failures/5734/5 "2007-11-15T20:16:03Z")

</div>

I've found a solution which ~~removes~~ broadens the limits. It will be included in the next release.

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [November 15, 2007, 9:00pm UTC](https://community.mp3tag.de/t/f-two-num-failures/5734/6 "2007-11-15T21:00:53Z")

</div>

> This is the upper limit of the int data type.

Doesn't the $add example show otherwise?

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [November 15, 2007, 9:37pm UTC](https://community.mp3tag.de/t/f-two-num-failures/5734/7 "2007-11-15T21:37:00Z")

</div>

$add already uses 64 bit instead of 32 bit integers.

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [November 15, 2007, 9:47pm UTC](https://community.mp3tag.de/t/f-two-num-failures/5734/8 "2007-11-15T21:47:09Z")

</div>

> $add already uses 64 bit instead of 32 bit integers.

Ah, so $add and $num use different types...

> I've found a solution

Thanks!

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [November 17, 2007, 6:53pm UTC](https://community.mp3tag.de/t/f-two-num-failures/5734/9 "2007-11-17T18:53:11Z")

</div>

> [@Florian](#):
>
> I've found a solution which ~~removes~~ broadens the limits. It will be included in the next release.

It has been changed in the current [Development Build](http://developer.mp3tag.de).

---

<div class="post-metadata">

### Author: ![chrisjj](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/a698b9/32.png) [@chrisjj](https://community.mp3tag.de/u/chrisjj)
#### Post date: [November 17, 2007, 11:01pm UTC](https://community.mp3tag.de/t/f-two-num-failures/5734/10 "2007-11-17T23:01:20Z")

</div>

Confirmed - both examples work in V2.39f.

Thanks! And thanks for the handy expression evaluator on ALT-1! 😉

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [December 28, 2018, 1:57pm UTC](https://community.mp3tag.de/t/f-two-num-failures/5734/11 "2018-12-28T13:57:33Z")

</div>

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