Re: Is still math.h the C++ math library ?

From: Bobo (pinzo_at_correo.nu)
Date: 04/01/04


Date: 1 Apr 2004 05:06:07 -0800


"Jonathan Turkanis" <technews@kangaroologic.com> wrote in message news:<c4g2le$2hivok$1@ID-216073.news.uni-berlin.de>...
> "AciD_X" <voodopeople@rocketNOSPAMmail.com> wrote in message
> news:pan.2004.04.01.00.40.12.58754@rocketNOSPAMmail.com...
> > On Wed, 31 Mar 2004 10:39:52 -0700, Jonathan Turkanis wrote:
> >
> > >
> > > "osmium" <r124c4u102@comcast.net> wrote in message
> > > news:c4ev62$2hoojv$1@ID-179017.news.uni-berlin.de...
> > >> Jonathan Turkanis writes:
>
> > >
> > > The contents of <math.h> and <cmath> are not the same: <math.h> is
> > > specified to define functions in the global namespace, <cmath> in
> the
> > > namespace std.
>
> <snip>
>
> > Do they differ in any way other than the namespace they are in ?
>
> That's the only difference.

If my memory is right <cmath> includes also overloads for every
<math.h> function, using float instead of double.
<math.h> <cmath>
double sin(double x) double std::sin(double x);
                          float std::sin(float x);
...

Regards.
Bobo.



Relevant Pages

  • Be careful when using MMX or Float point instructions in Delphi 2007
    ... For example, FillChar uses ... FLD/FST to fill memory. ... and it also uses X87 instructions. ... There is nothing wrong for a procedure to use float instructions, ...
    (borland.public.delphi.non-technical)
  • Re: Is VC++ 6.0 faster than VC++ .Net and VC# .Net ?
    ... will result in a memory allocation in C# for each iteration but will simply ... result into the re-utilisation of an object allocated on the stack in the ... it's very easy in C++ to use or access unallocated memory or to forget to ... public float Length ...
    (microsoft.public.vstudio.general)
  • Re: Vector efficiency
    ... <float>.get(i) to retrieve each record versus aligning the data into an array declared as float, and noticed about 2x computational speed improvement. ... I guess there are a number of step performing a look up with vector has to do as opposed to simple addressing through an array. ... There's also the memory issue (c.f. another ... Expenditure of computer time is not the only ...
    (comp.lang.java.help)
  • Re: Basics on real floating types
    ... With memory at low, low prices it seem hard to come up with sensible reasons to prefer float over double for the vast majority of applications. ... I've just tested the overhead of adding one extra level of function call to a function. ...
    (comp.lang.c)
  • Re: Reading Float Data from a binary file into ada
    ... would interpret the binary data for processing? ... SUBTYPE s_float IS float; ... NEW Ada.Unchecked_Conversion(aFourBytes, s_float); ... Unchecked conversion is the preferred way of copying the memory image from ...
    (comp.lang.ada)