# Command "indnv" cannot find index of a value

1

I find that when b is large in indnv(a, b), it returns a missing value, even if I know a is in vector b.

Here is an example that is not working for me:

```z = 1000;
b = seqa(-1/z,1/z,z+2);
a = { 0.049, 0.999 };
c = indnv(a,b);
print c;
```
```.
.
```

Help!

0
accepted

The problem here is not the size of b, but rounding errors inherent in floating point arithmetic. If you print all the digits in b you will see the difference.

```format /rd 16,16;
print b;
```

You will see that that second to last element of b is:

```0.9990000000000008
```

and if you print 0.999, it will be:

```0.9990000000000000
```

This is not a problem particular to GAUSS, it is a limitation of the double precision values that computers use. You can avoid this problem by making your original sequence from -1 to 1000 and the dividing by 1000 like this:

```z = 1000;
b = seqa(-1, 1, z+2)./z;
a = { 0.049, 0.999 };
c = indnv(a, b);
print c;
```

You should see:

```51.0000000000000000
1001.0000000000000000
```

I think this should work for you, because it does not require you to know any more information at the time of the creation of b.

0

When you say that b is large, do you mean that b has many elements, or that the individual values in b are large?

Do these examples work for you?
Example 1: Many elements in b

```b = rndn(1e7, 1);
idx = { 9, 41, 10009, 9999746 };
a = b[idx];
out = indnv(a,b);
print out;
```
``` 9.0000000
41.000000
10009.000
9999746.0
```

Example 2: Large values in b
Continuing with the data from above:

```b = b.*1e90;
a = b[idx];
out2 = indnv(a, b);
print out2;
```
``` 9.0000000
41.000000
10009.000
9999746.0
```

Both of these work for me using GAUSS version 13. Let me know if these work for you and/or a more specific description of your problem.

0

I mean b has many elements. I wonder why the following does not work:

```z=1000;
b=seqa(-1/z,1/z,z+2);
a=0.999;
indnv(0.999,b);
```

0
accepted

The problem here is not the size of b, but rounding errors inherent in floating point arithmetic. If you print all the digits in b you will see the difference.

```format /rd 16,16;
print b;
```

You will see that that second to last element of b is:

```0.9990000000000008
```

and if you print 0.999, it will be:

```0.9990000000000000
```

This is not a problem particular to GAUSS, it is a limitation of the double precision values that computers use. You can avoid this problem by making your original sequence from -1 to 1000 and the dividing by 1000 like this:

```z = 1000;
b = seqa(-1, 1, z+2)./z;
a = { 0.049, 0.999 };
c = indnv(a, b);
print c;
```

You should see:

```51.0000000000000000
1001.0000000000000000
```

I think this should work for you, because it does not require you to know any more information at the time of the creation of b.

0

When you say that b is large, do you mean that b has many elements, or that the individual values in b are large?

Do these examples work for you?
Example 1: Many elements in b

```b = rndn(1e7, 1);
idx = { 9, 41, 10009, 9999746 };
a = b[idx];
out = indnv(a,b);
print out;
```
``` 9.0000000
41.000000
10009.000
9999746.0
```

Example 2: Large values in b
Continuing with the data from above:

```b = b.*1e90;
a = b[idx];
out2 = indnv(a, b);
print out2;
```
``` 9.0000000
41.000000
10009.000
9999746.0
```

Both of these work for me using GAUSS version 13. Let me know if these work for you and/or a more specific description of your problem.

0

I mean b has many elements. I wonder why the following does not work:

```z=1000;
b=seqa(-1/z,1/z,z+2);
a=0.999;
indnv(0.999,b);
```

• ### Aptech Systems, Inc. Worldwide Headquarters

Aptech Systems, Inc.
2350 East Germann Road, Suite #21
Chandler, AZ 85286

Phone: 360.886.7100
FAX: 360.886.8922

• ### Training & Events

Want more guidance while learning about the full functionality of GAUSS and its capabilities? Get in touch for in-person training or browse additional references below.

• ### Tutorials

Step-by-step, informative lessons for those who want to dive into GAUSS and achieve their goals, fast.

• ### Want to find out more?

Get a real answer from a real person

• ### Have a Specific Question?

Get a real answer from a real person

• Need Support?
• ### Support Plans

Premier Support and Platinum Premier Support are annually renewable membership programs that provide you with important benefits including technical support, product maintenance, and substantial cost-saving features for your GAUSS System or the GAUSS Engine.

• ### User Forums

Join our community to see why our users are considered some of the most active and helpful in the industry!