Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
1.47/5 (5 votes)
See more:
In Vincenty ellipsoidal formula I'm working on, there is a an expression: 1e-12

How do I convert that into code, Some source say it is equivalent to 10 power(-12) or is it e = 2.71828182
Posted
Updated 13-Aug-15 9:10am
v2
Comments
nv3 16-Apr-12 7:32am    
It is 10 to the -12th.
Albert Holguin 16-Apr-12 11:04am    
You know, if you knew how to use a debugger, you could have answered this question yourself. Learn to use your debugger, it's a wonderful tool.
Sumal.V 16-Apr-12 11:16am    
Do u mean running the program in debugger using breakpoints?????
Albert Holguin 16-Apr-12 11:42am    
Yep, you could've just put a breakpoint and looked at what value was loaded onto a variable when you used that syntax.
Sumal.V 16-Apr-12 11:48am    
Yeah I know what u mean. I mostly use debugger but my problem was to write this code itself.
Didn't know if it was e or 10.

1 solution

It is the C/C++ notation for scientific numbers and can be read as 1 * 10-12. Just use it this way in C++:
C++
double f = 1e-12;
 
Share this answer
 
Comments
Albert Holguin 16-Apr-12 11:03am    
Pretty much all there is to it... +5
JackDingler 16-Apr-12 17:52pm    
Yeah, and it can essentially be treated as zero. It's likely to be the result of a calculation that rounded off, and produced a small error.

It's not uncommon in graphics applications to round numbers out to some significant number of digits, for human readability, and to correct for some rounding errors.
Jochen Arndt 17-Apr-12 2:39am    
It is the convergency limit for Vincenty's formula. See http://en.wikipedia.org/wiki/Vincenty%27s_formulae.
Afzaal Ahmad Zeeshan 13-Aug-15 15:09pm    
5ed
Richard MacCutchan 14-Aug-15 2:50am    
Look at the date of this question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900