www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2022/11/24/23:33:50

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Received: by 2002:a05:6214:2483:b0:4bb:59ec:c5a7 with SMTP id gi3-20020a056214248300b004bb59ecc5a7mr4665071qvb.94.1666429880864;
Sat, 22 Oct 2022 02:11:20 -0700 (PDT)
X-Received: by 2002:a25:c0c3:0:b0:6c1:34ce:ebe7 with SMTP id
c186-20020a25c0c3000000b006c134ceebe7mr21620377ybf.458.1666429880586; Sat, 22
Oct 2022 02:11:20 -0700 (PDT)
Newsgroups: comp.os.msdos.djgpp
Date: Sat, 22 Oct 2022 02:11:20 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=46.123.255.235; posting-account=CPdYWwoAAABpWBQIr4qTKwtnquUvEEfS
NNTP-Posting-Host: 46.123.255.235
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <80d78acb-55c9-4bd0-9198-2c3705e9489en@googlegroups.com>
Subject: is std::trunc() ever going to work?
From: "janezz55 (janezz55 AT gmail DOT com) [via djgpp AT delorie DOT com]" <djgpp AT delorie DOT com>
Injection-Date: Sat, 22 Oct 2022 09:11:20 +0000
Bytes: 1708
Lines: 10
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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>. 

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019