Neither is more correct than the other. They just represent different values.
1e-9
is 0.000000001
; the minus sign applies to the exponent.
-1e9
is -1000000000.0
; the minus sign applies to the number itself.
The e
(or E
) means “times 10-to-the”, so 1e9
is “one times ten to the ninth power”, and 1e-9
means “one times ten to the negative ninth power”. In mathematical scientific notation, this is usually denoted by a superscript: 1 × 10-9 or -1 × 109. Programming languages adopted the e
or E
notation because it was easier to type and print than a superscript (and still is, for that matter). (I think this may have been introduced by Fortran in the 1950s, but I’m not sure of the exact history.)
Related Posts:
- What is the difference between float and double?
- Error: “expression must have integral or unscoped enum type” [duplicate]
- Floating Point Exception C++ Why and what is it?
- Random float number generation
- What are the most widely used C++ vector/matrix math/linear algebra libraries, and their cost and benefit tradeoffs?
- C++ int float casting
- What are the distinctions between the various symbols (*,&, etc) combined with parameters?
- Converting from Radians to Degrees
- Is there a standard sign function (signum, sgn) in C/C++?
- C++ floating point to integer type conversions
- Finding square root without using sqrt function?
- Direct way of computing clockwise angle between 2 vectors
- C++ float array initialization
- What is a segmentation fault?
- Sleep for milliseconds
- C++ Cout & Cin & System “Ambiguous” [closed]
- Expression must be a modifiable lvalue
- How to read a file line by line or a whole text file at once?
- Split a string using C++11
- error: expected unqualified-id error: Meaning and fix? [duplicate]
- How to track down a “double free or corruption” error
- undefined reference to `WinMain@16′
- How can I clear console
- How to go from fopen to fopen_s
- make: g++: Command not found
- What is an ‘undeclared identifier’ error and how do I fix it?
- Use of “this” keyword in C++
- Why am I getting “undefined reference to main”
- Compiling C++11 with g++
- Setting an int to Infinity in C++
- What exactly is std::atomic?
- Separating class code into a header and cpp file
- Deep copy vs Shallow Copy
- Pointer to incomplete class type is not allowed
- std::string formatting like sprintf
- Sorting Characters Of A C++ String
- Sentinel while loop for C++
- How to ensure that a std::map is ordered?
- How to write C++ getters and setters
- std::out_of_range error?
- Checking cin input stream produces an integer
- Where do “pure virtual function call” crashes come from?
- C++: Expression must have a constant value when declaring array inside function
- What does ‘const static’ mean in C and C++?
- C++ wait for user input
- non-standard syntax; use ‘&’ to create a pointer to member
- How to shuffle a std::vector?
- Understanding glm::lookAt()
- How to get current timestamp in milliseconds since 1970 just the way Java gets
- What is the best open XML parser for C++?
- *** No rule to make target ‘class.cpp’, needed by `build/….x86/class.o` Stop. error in Ubuntu
- What’s the difference between opening a file with ios::binary or ios::out or both?
- Hash function for a string
- CMake error at CMakeLists.txt:30 (project): No CMAKE_C_COMPILER could be found
- How to run valgrind with basic c example?
- initial value of reference to non-const must be an lvalue
- access violation reading location c++
- C++ template constructor
- PlaySound in C++ Console application?
- Creation of Dynamic Array of Dynamic Objects in C++
- Compiling simple Hello World program on OS X via command line
- Cannot open output file, permission denied
- Strange error C2131: expression did not evaluate to a constant in VC 2015
- error: called object type ‘int’ is not a function or function pointer
- Hash function for a string
- Is there a replacement for unistd.h for Windows (Visual C)?
- How to call on a function found on another file?
- Why do you use typedef when declaring an enum in C++?
- What is wrong with using goto?
- Double pointer array in c++
- Don’t understand static boolean behavior
- How to write std::string to file?
- Member declaration not found
- What is the difference between a .cpp file and a .h file?
- Stable Cotangent
- How to change string into QString?
- Including .cpp files
- Class template inheritance C++
- The CXX compiler identification is unknown
- C++ compiler error: “return type specification for constructor invalid”
- error: ISO C++ forbids in-class initialization of non-const static member
- Function call missing argument list to create pointer
- cannot specify explicit initializer for arrays
- What does ** mean in C++?
- Incomplete type is not allowed: stringstream
- Initializing default values in a struct
- Warning: comparison of distinct pointer types
- Two decimal places using printf( )
- error C2244 unable to match function definition to an existing declaration
- Error: expression cannot be used as a function?
- What is a .h.gch file?
- MinGW .exe requires a few gcc dll’s regardless of the code?
- Converting bool to text in C++
- clearing a vector of pointers [duplicate]
- Evaluate a string with a switch in C++ [duplicate]
- C++ JSON Serialization
- stack around the variable…was corrupted
- Creating a list to hold objects in C++
- What does “warning: not all control paths return a value” mean? (C++)
- Array of Linked Lists C++