Precision in C
-
Hi, I have a value float a=1234.5578 I want to print output as 1234.55. How to approach this ?
-
Hi, I have a value float a=1234.5578 I want to print output as 1234.55. How to approach this ?
Read up on printf formatting. Google will find you lots of tutorials and references.
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
-
Hi, I have a value float a=1234.5578 I want to print output as 1234.55. How to approach this ?
-
Hi, I have a value float a=1234.5578 I want to print output as 1234.55. How to approach this ?
Unless you are going to be programming large scale complex mathematical problems you should stay well clear of floating point numbers. There are quite a few issues to be understood which can catch you out. And given this and the question below, your time would be better spent getting hold of a good C++ study guide. Trying to learn by posting questions here will take you far too much time.
-
Hi, I have a value float a=1234.5578 I want to print output as 1234.55. How to approach this ?
Try here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles