Request Short Link
C++ 98
C++ 11
C++ 14
C++ 17
C++ 20
C++ 23
C++ 2c
for-loops as while-loops
array subscription
Show all implicit casts
Show all template parameters of a CallExpr
Use libc++
Transform std::initializer_list
Show noexcept internals
Show padding information
Show coroutine transformation
Show C++ to C transformation
Show object lifetime
Default
15
18
20
22
26
More
GitHub
Patreon
Issues
About
Policies
Examples
C++ Insights @ YouTube
Settings
Version
Need in-house C++ training? Learn more here
×
Made by
Andreas Fertig
Powered by
Flask
and
CodeMirror
Source:
#include <cmath> #include <iostream> #include <limits> using namespace std; int main() { uint64_t offset = 1164226701485, size = 945, div = 10000; std::cerr.precision(17); std::cerr << std::numeric_limits<float>::digits10 << '\n'; std::cerr << offset / div << '\n'; std::cerr << static_cast<float>(offset / div) << '\n'; for (uint64_t off = offset / div; off < ceil((float)(offset + size) / div); off++) { cout << off << ' '; } std::cout << "-------\n"; for (uint64_t off = offset / div; off < static_cast<uint64_t>(ceil((float)(offset + size) / div)); off++) { cout << off << ' '; } return 0; }
Insight:
Console: