# How to reduce precision in Octave? [closed]

I want to round the actual value of a variable to a certain precision point.

Example:

.3333333333333

to

.3333300000000

(rounding to .00001)

Is this possible?

-

## closed as off topic by Marvis, Davide Giraudo, draks ..., Micah, tomaszDec 23 '12 at 15:03

Questions on Mathematics Stack Exchange are expected to relate to math within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

Voting to close this as off-topic. – user17762 Dec 23 '12 at 10:53
Yes, this question belongs to Stackoverflow. – Barnabas Szabolcs Dec 23 '12 at 10:54
why is this off topic? – Vigrond Dec 23 '12 at 10:54
This question could have had both a programmatic solution or mathematical. It turns out the solution was mathematical. I was leaning toward wanting a mathematical solution (as my research didn't find a programmatic solution), so I posted it here. – Vigrond Dec 23 '12 at 10:57
In the FAQ, the fifth bullet says "We welcome questions about... Software that mathematicians use." – robjohn Dec 23 '12 at 12:03

$$\left[ 10^5 x \right] / 10^5$$
The idea is that $10^5$ times the rounded value of $x$ is an integer, so we simply shift the problem over so that we can ask for the nearest integer, then shift back.
Ah sorry. The typical symbols in mathematics notation are $\lfloor x \rfloor$ for the floor function, $\lceil x \rceil$ for the ceiling function, and $[x]$ for the nearest integer function. – Hurkyl Dec 23 '12 at 10:54
@Hurkyl: where all of these characters are available, I like to use $[x]$ for nearest integer. However, for those of us who were stuck previously on ASCII only usenet forums, [x] usually meant "floor of $x$", and sometimes we get confused about its intended usage on math.SE. – robjohn Dec 23 '12 at 17:08