3

I want to write my own version of std::nearbyint which takes a float & returns the nearest int. This is because, it doesn't build on android gcc with ndk 14b. Something like this suggested for std::round.

Is it feasible ? any suggestions ?

I am using qmake with android gcc & it seems ridiculously difficult to build this math function no matter whatever compiler flag I use. tried the suggestions here & here. But, the problem seems to be that some math functions are missing in android gcc as suggested in ndk issues

Community
  • 1
  • 1
TheWaterProgrammer
  • 7,055
  • 12
  • 70
  • 159
  • Please don't repost (essentially) the same question (http://stackoverflow.com/questions/43739081/android-ndk-complains-stdnearbyint-is-not-a-member-of-std) – chtz May 02 '17 at 17:12
  • 1
    this question is different than the one you mentioned. this question is to the point & straight - " how to implement my own `std::nearbyint` ? " – TheWaterProgrammer May 02 '17 at 20:06
  • I think eventually you have to deal with binary representation of floating point types. – Tomilov Anatoliy May 04 '17 at 16:15

0 Answers0