I tried to use std::trunc(), but it doesn't work and browsing through header files revealed gcc does not trust the math.h header file DJGPP provides and so does not declare it. trunc(), truncf(), truncl() work as expected though.
the error is:
error: 'trunc' is not a member of 'std'; did you mean 'trunc'? /usr/i586-pc-msdosdjgpp/include/math.h:195:15: note: 'trunc' declared here
195 | extern double trunc(double);
apparently the macro __CORRECT_ISO_CPP11_MATH_H_PROTO_FP is not defined. Defining it explicitly produces errors related to isnan().
Documentation about the macro says: Define if all C++11 floating point overloads are available in <math.h>.
The issue is that djgpp does not implement all C99 math functions, so libstdc++ just disables all of them. You can of course use ::trunc()
from libc or __builtin_trunc() (with f/l suffix where appropriate).
|Location:||Huddersfield, West Yorkshire, UK|
|Nodes:||16 (0 / 16)|