# Precision numbers...

0

Hello, with the following code :

```a = rndn(100,1);
print meanc(a-meanc(a));
```

returns something like :

```2.2204460e-017
```

What should I do to get 0 ???

Thanks,

Guillaume Monarcha

0

PS : I use GAUSS ENGINE 13

0

You change the format of your print statements by using the format command. Here is a basic example:

```a = rndn(100,1);

format /rd 8,3;
print meanc(a - meanc(a));
```

This will return:

```  0.000
```

The first input to format, in this case /rd, tells GAUSS to:

1. r - right format the printed output
2. d - print the data as a decimal

The second input to format, in this case 8,3, tells GAUSS to:

1. 8 - give each printed number enough space for 8 characters
2. 3 - print out 3 decimal places
3. If you wanted to print numbers that were left formatted using scientific notation rather than decimal format and wanted to print 4 decimals, you could enter:

```format /le 8,4;
print meanc(a - meanc(a));
```

This will return something like:

```2.2204e-17
```

Besides the d and e options, you can also use the z option. This will use either decimal or scientific notation, whichever is more concise. It will also suppress trailing zeros. Here is a link to another post describing this.

asked December 18, 2013

0

PS : I use GAUSS ENGINE 13

0

You change the format of your print statements by using the format command. Here is a basic example:

```a = rndn(100,1);

format /rd 8,3;
print meanc(a - meanc(a));
```

This will return:

```  0.000
```

The first input to format, in this case /rd, tells GAUSS to:

1. r - right format the printed output
2. d - print the data as a decimal

The second input to format, in this case 8,3, tells GAUSS to:

1. 8 - give each printed number enough space for 8 characters
2. 3 - print out 3 decimal places
3. If you wanted to print numbers that were left formatted using scientific notation rather than decimal format and wanted to print 4 decimals, you could enter:

```format /le 8,4;
print meanc(a - meanc(a));
```

This will return something like:

```2.2204e-17
```

Besides the d and e options, you can also use the z option. This will use either decimal or scientific notation, whichever is more concise. It will also suppress trailing zeros. Here is a link to another post describing this.

• ### 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

Ready to Get Started?

• ### 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!

• ### Where to Buy

Available across the globe, you can have access to GAUSS no matter where you are.