Saturday, 15 September 2012

C++ Can you keep a double or float with trailing zeroes (NOT a string or output)? -


I know that by using the output precision, or after converting to a string, leaving or adding indexed zeros There are several ways.

But, there is a way to keep zero on the actual zero, float or any other data type, which at the end holds 0. 0. like 1! = .10

The reason, zero shows that we know that the next digit is a zero. 1 shows that we all know that there is up to 1 and not later.

Of course I can convert to string or create a custom class that monitors it. I'm using a lot of couples though, and I want to leave something like this that is possible. I think there is all the ways to mess with wire and output. Something like double Precision (x) would be good =)

Thanks! IEE's floating-point formats do not have many ways to store (finite, cement, non-zero) values, otherwise you can not internalize that numerical variable.

You will need to keep a pair of (value, exact) ( (value, uncertainty) - which is most important to you ).


No comments:

Post a Comment