- Notifications
You must be signed in to change notification settings - Fork5
Commit73193d8
committed
Adjust degree-based trig functions for more portability.
The buildfarm isn't very happy with the results of commite1bd684.To try to get the expected exact results everywhere:* Replace M_PI / 180 subexpressions with a precomputed constant, so thatthe compiler can't decide to rearrange that division with an adjacentoperation. Hopefully this will fix failures to get exactly 0.5 fromsind(30) and cosd(60).* Add scaling to ensure that tand(45) and cotd(45) give exactly 1; therewas nothing particularly guaranteeing that before.* Replace minus zero by zero when tand() or cotd() would output that;many machines did so for tand(180) and cotd(270), but not all. We couldalternatively deem both results valid, but that doesn't seem likely tobe what users will want.1 parent6ae4c8d commit73193d8
File tree
5 files changed
+60
-15
lines changed- src
- backend/utils/adt
- test/regress/expected
5 files changed
+60
-15
lines changedLines changed: 52 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
31 | 31 |
| |
32 | 32 |
| |
33 | 33 |
| |
| 34 | + | |
| 35 | + | |
| 36 | + | |
34 | 37 |
| |
35 | 38 |
| |
36 | 39 |
| |
| |||
1919 | 1922 |
| |
1920 | 1923 |
| |
1921 | 1924 |
| |
1922 |
| - | |
| 1925 | + | |
1923 | 1926 |
| |
1924 | 1927 |
| |
1925 | 1928 |
| |
| |||
1931 | 1934 |
| |
1932 | 1935 |
| |
1933 | 1936 |
| |
1934 |
| - | |
1935 |
| - | |
| 1937 | + | |
| 1938 | + | |
1936 | 1939 |
| |
1937 | 1940 |
| |
1938 | 1941 |
| |
| |||
2030 | 2033 |
| |
2031 | 2034 |
| |
2032 | 2035 |
| |
2033 |
| - | |
2034 | 2036 |
| |
| 2037 | + | |
| 2038 | + | |
2035 | 2039 |
| |
2036 | 2040 |
| |
2037 | 2041 |
| |
| |||
2071 | 2075 |
| |
2072 | 2076 |
| |
2073 | 2077 |
| |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
2074 | 2098 |
| |
2075 | 2099 |
| |
2076 | 2100 |
| |
| |||
2133 | 2157 |
| |
2134 | 2158 |
| |
2135 | 2159 |
| |
2136 |
| - | |
2137 | 2160 |
| |
| 2161 | + | |
| 2162 | + | |
2138 | 2163 |
| |
2139 | 2164 |
| |
2140 | 2165 |
| |
| |||
2174 | 2199 |
| |
2175 | 2200 |
| |
2176 | 2201 |
| |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
| 2216 | + | |
| 2217 | + | |
| 2218 | + | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
2177 | 2222 |
| |
2178 | 2223 |
| |
2179 | 2224 |
| |
| |||
2188 | 2233 |
| |
2189 | 2234 |
| |
2190 | 2235 |
| |
2191 |
| - | |
| 2236 | + | |
2192 | 2237 |
| |
2193 | 2238 |
| |
2194 | 2239 |
| |
| |||
2214 | 2259 |
| |
2215 | 2260 |
| |
2216 | 2261 |
| |
2217 |
| - | |
| 2262 | + | |
2218 | 2263 |
| |
2219 | 2264 |
| |
2220 | 2265 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
467 | 467 |
| |
468 | 468 |
| |
469 | 469 |
| |
470 |
| - | |
| 470 | + | |
471 | 471 |
| |
472 | 472 |
| |
473 | 473 |
| |
474 | 474 |
| |
475 | 475 |
| |
476 |
| - | |
| 476 | + | |
477 | 477 |
| |
478 | 478 |
| |
479 | 479 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
465 | 465 |
| |
466 | 466 |
| |
467 | 467 |
| |
468 |
| - | |
| 468 | + | |
469 | 469 |
| |
470 | 470 |
| |
471 | 471 |
| |
472 | 472 |
| |
473 | 473 |
| |
474 |
| - | |
| 474 | + | |
475 | 475 |
| |
476 | 476 |
| |
477 | 477 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
465 | 465 |
| |
466 | 466 |
| |
467 | 467 |
| |
468 |
| - | |
| 468 | + | |
469 | 469 |
| |
470 | 470 |
| |
471 | 471 |
| |
472 | 472 |
| |
473 | 473 |
| |
474 |
| - | |
| 474 | + | |
475 | 475 |
| |
476 | 476 |
| |
477 | 477 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
467 | 467 |
| |
468 | 468 |
| |
469 | 469 |
| |
470 |
| - | |
| 470 | + | |
471 | 471 |
| |
472 | 472 |
| |
473 | 473 |
| |
474 | 474 |
| |
475 | 475 |
| |
476 |
| - | |
| 476 | + | |
477 | 477 |
| |
478 | 478 |
| |
479 | 479 |
| |
|
0 commit comments
Comments
(0)