[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnash-commit] [SCM] Gnash branch, master, updated. 5a8952cf6f6675fa
From: |
Sandro Santilli |
Subject: |
Re: [Gnash-commit] [SCM] Gnash branch, master, updated. 5a8952cf6f6675fa7ce2bb91986133419459e3f4 |
Date: |
Thu, 2 Dec 2010 09:07:47 +0100 |
On Thu, Dec 02, 2010 at 06:47:11AM +0000, Sandro Santilli wrote:
> - const double a2 = std::pow(static_cast<double>(a()), 2.0);
> - const double b2 = std::pow(static_cast<double>(b()), 2.0);
> + const double a2 = std::pow(static_cast<double>(a()), 2);
> + const double b2 = std::pow(static_cast<double>(b()), 2);
> return std::sqrt(a2 + b2) / 65536.0;
Sorry, the change was likely unneeded, the slave was down so got confused
by last build error.
Candidates were:
double pow(double, double) <--- picked by rob's code
float std::pow(float, float)
long double std::pow(long double, long double)
double std::pow(double, int) <--- picked by my code
float std::pow(float, int)
long double std::pow(long double, int)
Some days ago someone suggested to use hypot(3) for sqrt(a2+b2)
double hypot(double x, double y);
float hypotf(float x, float y);
long double hypotl(long double x, long double y);
CONFORMING TO
C99, POSIX.1-2001. The variant returning double also conforms to SVr4,
4.3BSD.
The code would become:
- const double a2 = std::pow(static_cast<double>(a()), 2);
- const double b2 = std::pow(static_cast<double>(b()), 2);
- return std::sqrt(a2 + b2) / 65536.0;
+ const double ad = static_cast<double>(a());
+ const double bd = static_cast<double>(b());
+ return std::hypot(ad, bd) / 65536.0;
Worth it ?
--strk;
() Free GIS & Flash consultant/developer
/\ http://strk.keybit.net/services.html
- [Gnash-commit] [SCM] Gnash branch, master, updated. 5a8952cf6f6675fa7ce2bb91986133419459e3f4, Sandro Santilli, 2010/12/02
- Re: [Gnash-commit] [SCM] Gnash branch, master, updated. 5a8952cf6f6675fa7ce2bb91986133419459e3f4,
Sandro Santilli <=
- Re: [Gnash-commit] [SCM] Gnash branch, master, updated. 5a8952cf6f6675fa7ce2bb91986133419459e3f4, Sandro Santilli, 2010/12/02
- Re: [Gnash-commit] [SCM] Gnash branch, master, updated. 5a8952cf6f6675fa7ce2bb91986133419459e3f4, Benjamin Wolsey, 2010/12/02
- Re: [Gnash-commit] [SCM] Gnash branch, master, updated. 5a8952cf6f6675fa7ce2bb91986133419459e3f4, Sandro Santilli, 2010/12/02
- Re: [Gnash-commit] [SCM] Gnash branch, master, updated. 5a8952cf6f6675fa7ce2bb91986133419459e3f4, Benjamin Wolsey, 2010/12/02