octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Apple atan2f


From: Ben Abbott
Subject: Re: Apple atan2f
Date: Tue, 16 Nov 2010 18:46:57 -0500

On Nov 16, 2010, at 6:42 PM, Jordi GutiƩrrez Hermoso wrote:

> On 16 November 2010 17:29, Ben Abbott <address@hidden> wrote:
> 
>> Using Apple's compiler (gcc 4.2.1 with their patches) I get the error below.
>> 
>> $ g++ -O0 -frounding-math -std=c++0x    rndtst.cpp   -o rndtst
>> cc1plus: error: unrecognized command line option "-std=c++0x"
> 
> gcc 4.3 was where C++0x features (updates to the C++ standard) were
> beginning to be implemented, but gcc 4.3 is also where the move to
> GPLv3 was done. Apple seems intent on shunning GPLv3 as much as
> possible. This is largely whence Apple's interest in clang: it's not
> copylefted. They pay some lip service to technical merit, but the fact
> is that Apple is trying to stifle copylefted software. Pity, because
> clang doesn't implement much or any of C++0x, and I expect it won't
> for some time.
> 
> Sorry for the lecture, but I actually find this worrying. It might
> create a schism between developers in GNU-based systems and Mac OS X
> users, where we'll now have to worry about supporting two major
> compilers instead of focussing mostly on gcc. True that Octave tries
> to be very compatible across compilers, but clang would be yet another
> compiler to support, and a major one at that. I expect that packaing
> higher versions of gcc for macports or similar will be a chore few
> will attend to.
> 
> - Jordi G. H>

Running g++ 4.4, I get

$ ./rndtst
Please enter '0.0' and hit <Return> 
0.0
--------------------
Default round mode is 0
TOWARDZERO round mode is 3072
TONEAREST round mode is 0
--------------------
TONEAREST : (float) almostpi = 3.1415925 (0x40490fda)
TONEAREST : (float) M_PI = 3.1415927 (0x40490fdb)
TOWARDZERO: (float) M_PI = 3.1415925 (0x40490fda)
TOWARDZERO: (float) almostpi = 3.1415925 (0x40490fda)
--------------------
Computed with TONEAREST
atan2f (0.0f, -1.0f) = 3.14159250 (0x40490fda)
atan2f (0.0f, -1.0f) - (float) M_PI = -0.00000024 (0xb4800000)
2*asinf (1.0f) = 3.14159250 (0x40490fda)
2*asinf (0.0f, -1.0f) - (float) M_PI = -0.00000024 (0xb4800000)
--------------------
Computed with TOWARDZERO
atan2f (0.0f, -1.0f) = 3.14159226 (0x40490fd9)
atan2f (0.0f, -1.0f) - (float) M_PI = -0.00000023 (0xb4800000)
2*asinf (1.0f) = 3.14159226 (0x40490fd9)
2*asinf (0.0f, -1.0f) - (float) M_PI = -0.00000023 (0xb4800000)
--------------------

Regarding Apple, it is possible to use non-Apple compilers. It is just a hassle 
to manage all the dependencies. Often needing two copies. On for Apple and 
another for gnu.

Ben







reply via email to

[Prev in Thread] Current Thread [Next in Thread]