Not sure that it matters but the doc specifies 

#include <math.h>

Are you possibly getting the wrong math.h?

You could also try

#define _TR1_C99
#include <math.h>

Charles


-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On
Behalf Of Baguley, Nicholas: Absa
Sent: Wednesday, August 2, 2017 6:01 AM
To: [email protected]
Subject: XL C++ and the missing trunc()

Hi List

I am trying to compile some code

        16761 | #define _ISOC99_SOURCE
        16762 | #include "math.h"
        16763 | ..dNewValue = trunc(dValue*dDigits) / dDigits;

Getting error:


============================================¬
"/u/abnb529/cpf/source/XMM021D.C", line 16763.29: CCN5274 (S) The name
lookup for "trunc" did not find a declaration.
        16764 |


Running 15650ZOS V2.2 z/OS XL C++

Version Macros. . . . . . . . : __COMPILER_VER__=0x42020000
                              : __LIBREL__=0x42020000
                              : __TARGET_LIB__=0x42020000

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to