ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2011/02/14/13:45:30

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Jim Michaels <jmichae3 AT yahoo DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: bug in math.h
Date: Mon, 14 Feb 2011 10:32:57 -0800 (PST)
Organization: http://groups.google.com
Lines: 26
Message-ID: <405f577c-fbcc-4f59-9141-925f1ff95695@a28g2000prb.googlegroups.com>
NNTP-Posting-Host: 71.237.186.184
Mime-Version: 1.0
X-Trace: posting.google.com 1297708377 20299 127.0.0.1 (14 Feb 2011 18:32:57 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: Mon, 14 Feb 2011 18:32:57 +0000 (UTC)
Complaints-To: groups-abuse AT google DOT com
Injection-Info: a28g2000prb.googlegroups.com; posting-host=71.237.186.184; posting-account=05hOMwoAAAB6R8xtiQKzEljSMzgOhVF1
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13)
Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729),gzip(gfe)
Bytes: 1942
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

lround, round, and powl and I'm sure others to not show up in math.h.


#include <math.h>
using namespace std;

            int32_t n=lround(440*powl(2, (((double(octave)-3) * 12.0)
+ double(note)) / 12.0));

this is for calculating the frequency of a musical note.

beep.cpp:111: error: 'powl' was not declared in this scope
beep.cpp:111: error: 'lround' was not declared in this scope

I looked at the source code for math.h and what it includes, and it is
supposed to define these two, as does mingw-w64.

using std::tr1::lround;

but lround is not defined from what I can see.
pow is.  I should think powl should be defined, but it is not.

when I use pow and round, I get the following error message:
            int32_t n=round(440*pow(2, (((double(octave)-3) * 12.0) +
double(note)) / 12.0));
beep.cpp:111: error: 'round' was not declared in this scope

- Raw text -


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