Solved

precision past decimal

Posted on 1998-08-24
3
172 Views
Last Modified: 2010-04-01
I am working on a calculation that needs to be able output
the product with a precision of at minimum of 10 digits behind the decimal point. I have been able to get 6 digits using standard output. Does any one know how I might be able to do this? Without ending up with something like
3.3333e-05
0
Comment
Question by:bbarnette
  • 2
3 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 20 total points
ID: 1171133
double a = 0.123456789;
printf("%.10e", a);
0
 
LVL 23

Expert Comment

by:chensu
ID: 1171134
Or printf("%.10f", a);

printf("%.10g", a);
0
 

Author Comment

by:bbarnette
ID: 1171135
"f", did it thanks
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question