help-gplusplus
[Top][All Lists]
Advanced

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

Re: Help with Hand-Optimized Assembly


From: Terje Mathisen
Subject: Re: Help with Hand-Optimized Assembly
Date: Wed, 28 Mar 2012 18:29:59 -0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20111221 Firefox/9.0.1 SeaMonkey/2.6.1

Tim Roberts wrote:
Terje Mathisen<"terje.mathisen at tmsw.no"@giganews.com>  wrote:

Inline C isn't too hard to write:

Have you tried this code?

inline double delta(double th1, th2)
{
     static double pi = 3.14159265357989;
     static double zero_or_twopi[2] = {0, 3.14159265357989*2};
     static double absmask = (double) 0x7fffffffffffffff;

That doesn't do what you think it does.  That cast converts the constant to
floating point -- it doesn't just copy the bits.  There are only 56 bits of
mantissa available in a double, so some of your bits get lost.

I do know that,I was in a hurry and tried to get away with psudocode, but I should have stated that clearly.

Thanks for correcting my omissions!

Terje--
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"


reply via email to

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