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

Commit0034757

Browse files
committed
Yet further adjust degree-based trig functions for more portability.
Buildfarm member cockatiel is still saying that cosd(60) isn't 0.5.What seems likely is that the subexpression (1.0 - cos(x)) isn't beingrounded to double width before more arithmetic is done on it, so forcethat by storing it into a variable.
1 parent360f67d commit0034757

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2000,7 +2000,9 @@ sind_0_to_30(double x)
20002000
staticdouble
20012001
cosd_0_to_60(doublex)
20022002
{
2003-
return1.0- ((1.0-cos(x*RADIANS_PER_DEGREE)) /one_minus_cos_60) /2.0;
2003+
float8one_minus_cos_x=1.0-cos(x*RADIANS_PER_DEGREE);
2004+
2005+
return1.0- (one_minus_cos_x /one_minus_cos_60) /2.0;
20042006
}
20052007

20062008

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp