Because of integer truncation. pow()
returns a floating point value, and due to floating point arithmetic, it is probably ~ 99.999...
; however, due to integer truncation, even 99.999...
gets truncated down to 99.
More Related Contents:
- How exactly does __attribute__((constructor)) work?
- Why does integer overflow on x86 with GCC cause an infinite loop?
- Capturing function exit time with __gnu_mcount_nc
- Why is my program slow when looping over exactly 8192 elements?
- How do I list the symbols in a .so file
- C++ syntax for explicit specialization of a template function in a template class?
- Error “undefined reference to ‘std::cout'”
- How to compile for Windows on Linux with gcc/g++?
- GCC STL bound checking
- std::stoi doesn’t exist in g++ 4.6.1 on MinGW
- Explicit specialization in non-namespace scope does not compile in GCC
- C++: Safe to use longjmp and setjmp?
- How to use OpenSSL’s SHA256 functions
- How to get a stack trace for C++ using gcc with line number information?
- How to link using GCC without -l nor hardcoding path for a library that does not follow the libNAME.so naming convention?
- Is RVO (Return Value Optimization) applicable for all objects?
- Linking problems due to symbols with abi::cxx11?
- RDRAND and RDSEED intrinsics on various compilers?
- How to enable experimental C++11 concurrency features in MinGW?
- C++ : friend declaration ‘declares a non-template function
- Can I link a plain file into my executable? [duplicate]
- What is “strip” (GCC application) used for?
- What does -fPIC mean when building a shared library?
- Static and Dynamic/Shared Linking with MinGW
- Difference between regex_match and regex_search?
- Why does sqrt() work fine on an int variable if it is not defined for an int?
- counting the number of lines in a text file
- Should std::unique_ptr be permitted
- What is the order of evaluation in a member initializer list?
- How do I use google mock in C?