Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit360f67d

Browse files
committed
Still further adjust degree-based trig functions for more portability.
Indeed, the non-static declaration foreseen in my previous commit messageis necessary. Per Noah Misch.
1 parent65abaab commit360f67d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

‎src/backend/utils/adt/float.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ static intfloat8_cmp_internal(float8 a, float8 b);
8383
staticdoublesind_q1(doublex);
8484
staticdoublecosd_q1(doublex);
8585

86+
/* This is INTENTIONALLY NOT STATIC. Don't "fix" it. */
87+
voidinit_degree_constants(float8thirty,float8forty_five,float8sixty,
88+
float8one_half,float8one);
89+
8690
#ifndefHAVE_CBRT
8791
/*
8892
* Some machines (in particular, some versions of AIX) have an extern
@@ -1771,11 +1775,16 @@ dtan(PG_FUNCTION_ARGS)
17711775
* want exact results, we must ensure that none of the scaling constants used
17721776
* in the degree-based trig functions are computed that way.
17731777
*
1778+
* The whole approach fails if init_degree_constants() gets inlined into the
1779+
* call sites, since then constant-folding can happen anyway. Currently it
1780+
* seems sufficient to declare it non-static to prevent that. We have no
1781+
* expectation that other files will call this, but don't tell gcc that.
1782+
*
17741783
* Other hazards we are trying to forestall with this kluge include the
17751784
* possibility that compilers will rearrange the expressions, or compute
17761785
* some intermediate results in registers wider than a standard double.
17771786
*/
1778-
staticvoid
1787+
void
17791788
init_degree_constants(float8thirty,float8forty_five,float8sixty,
17801789
float8one_half,float8one)
17811790
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp