-1

I have a code writes a robot coordination in a file. Sometimes, for an unknown reason, instead of a number like 0.01845, it writes 6.92113e-310. So I'd like to filter data raised to a power greater than -12. Is there a way to achieve this in C++?

Edvard
  • 21
  • 6

1 Answers1

-1

Just to help with the math: you get the exponent using std::log10.

This actually returns the exponent as the integer part, and the significand (the 6.9113 before the e) controls the fractional part of log10.

Filtering a collection by a predicate should be in your C++ textbook.

MSalters
  • 173,980
  • 10
  • 155
  • 350