github.com/matrixorigin/matrixone@v0.7.0/test/distributed/cases/function/func_math_trig.result (about) 1 SELECT SIN(PI()); 2 SIN(PI()) 3 1.2246467991473532E-16 4 SELECT ROUND(SIN(PI())); 5 ROUND(SIN(PI())) 6 0.0 7 SELECT COS(PI()); 8 COS(PI()) 9 -1.0 10 SELECT COT(12); 11 COT(12) 12 -1.5726734063976895 13 SELECT TAN(PI()); 14 TAN(PI()) 15 -1.2246467991473532E-16 16 SELECT TAN(PI()+1); 17 TAN(PI()+1) 18 1.5574077246549016 19 SELECT ACOS(1); 20 ACOS(1) 21 0.0 22 SELECT ACOS(1.0001); 23 ACOS(1.0001) 24 null 25 SELECT ACOS(0); 26 ACOS(0) 27 1.5707963267948966 28 SELECT ATAN(2); 29 ATAN(2) 30 1.1071487177940906 31 SELECT ATAN(-2); 32 ATAN(-2) 33 -1.1071487177940906 34 SELECT ATAN(-2,2); 35 ATAN(-2,2) 36 -0.7853981633974483 37 SELECT SIN(13413); 38 SIN(13413) 39 -0.9995549842668945 40 SELECT SIN(-3114); 41 SIN(-3114) 42 0.6300986853612236 43 SELECT SIN(1); 44 SIN(1) 45 0.8414709848078965 46 SELECT SIN(-1); 47 SIN(-1) 48 -0.8414709848078965 49 SELECT SIN(0); 50 SIN(0) 51 0.0 52 SELECT SIN(0.001); 53 SIN(0.001) 54 9.999998333333417E-4 55 SELECT SIN(-0.001); 56 SIN(-0.001) 57 -9.999998333333417E-4 58 SELECT SIN("ABC"); 59 strconv.ParseFloat: parsing "ABC": invalid syntax 60 SELECT COS(13413); 61 COS(13413) 62 -0.02983007588338295 63 SELECT COS(-3114); 64 COS(-3114) 65 -0.7765150653439106 66 SELECT COS(1); 67 COS(1) 68 0.5403023058681398 69 SELECT COS(-1); 70 COS(-1) 71 0.5403023058681398 72 SELECT COS(0); 73 COS(0) 74 1.0 75 SELECT COS(0.001); 76 COS(0.001) 77 0.9999995000000417 78 SELECT COS(-0.001); 79 COS(-0.001) 80 0.9999995000000417 81 SELECT COS("ABC"); 82 strconv.ParseFloat: parsing "ABC": invalid syntax 83 SELECT TAN(13413); 84 TAN(13413) 85 33.50829505679211 86 SELECT TAN(-3114); 87 TAN(-3114) 88 -0.8114442507076914 89 SELECT TAN(1); 90 TAN(1) 91 1.557407724654902 92 SELECT TAN(-1); 93 TAN(-1) 94 -1.557407724654902 95 SELECT TAN(0); 96 TAN(0) 97 0.0 98 SELECT TAN(0.001); 99 TAN(0.001) 100 0.0010000003333334668 101 SELECT TAN(-0.001); 102 TAN(-0.001) 103 -0.0010000003333334668 104 SELECT TAN("ABC"); 105 strconv.ParseFloat: parsing "ABC": invalid syntax 106 SELECT COT(13413); 107 COT(13413) 108 0.029843356646619378 109 SELECT COT(-3114); 110 COT(-3114) 111 -1.2323705530328941 112 SELECT COT(1); 113 COT(1) 114 0.6420926159343308 115 SELECT COT(-1); 116 COT(-1) 117 -0.6420926159343308 118 SELECT COT(0.001); 119 COT(0.001) 120 999.9996666666443 121 SELECT COT(-0.001); 122 COT(-0.001) 123 -999.9996666666443 124 select cot(0); 125 invalid argument cot, bad value cot(0) 126 SELECT ATAN(13413); 127 ATAN(13413) 128 1.5707217722583913 129 SELECT ATAN(-3114); 130 ATAN(-3114) 131 -1.5704751964270016 132 SELECT ATAN(1); 133 ATAN(1) 134 0.7853981633974483 135 SELECT ATAN(-1); 136 ATAN(-1) 137 -0.7853981633974483 138 SELECT ATAN(0); 139 ATAN(0) 140 0.0 141 SELECT ATAN(0.001); 142 ATAN(0.001) 143 9.999996666668668E-4 144 SELECT ATAN(-0.001); 145 ATAN(-0.001) 146 -9.999996666668668E-4 147 SELECT ATAN("ABC"); 148 strconv.ParseFloat: parsing "ABC": invalid syntax 149 SELECT SIN(NULL); 150 SIN(NULL) 151 null 152 SELECT COS(NULL); 153 COS(NULL) 154 null 155 SELECT TAN(NULL); 156 TAN(NULL) 157 null 158 SELECT COT(NULL); 159 COT(NULL) 160 null 161 SELECT ACOS(NULL); 162 ACOS(NULL) 163 null 164 SELECT ATAN(NULL); 165 ATAN(NULL) 166 null 167 create table t1(a tinyint, b SMALLINT, c bigint, d INT, e BIGINT, f FLOAT, g DOUBLE, h decimal(38,19), i DATE, k datetime, l TIMESTAMP, m char(255), n varchar(255)); 168 insert into t1 values(1, 1, 2, 43, 5, 35.5, 31.133, 14.314, "2012-03-10", "2012-03-12 10:03:12", "2022-03-12 13:03:12", "ab23c", "d5cf"); 169 insert into t1 values(71, 1, 2, 34, 5, 5.5, 341.13, 15.314, "2012-03-22", "2013-03-12 10:03:12", "2032-03-12 13:04:12", "abr23c", "3dcf"); 170 insert into t1 values(1, 1, 21, 4, 54, 53.5, 431.13, 14.394, "2011-03-12", "2015-03-12 10:03:12", "2002-03-12 13:03:12", "afbc", "dct5f"); 171 insert into t1 values(1, 71, 2, 34, 5, 5.5, 31.313, 124.314, "2012-01-12", "2019-03-12 10:03:12", "2013-03-12 13:03:12", "3abd1c", "dcvf"); 172 select sin(a), cos(a), tan(a),cot(a),acos(a),atan(a) from t1; 173 sin(a) cos(a) tan(a) cot(a) acos(a) atan(a) 174 0.8414709848078965 0.5403023058681398 1.557407724654902 0.6420926159343308 0.0 0.7853981633974483 175 0.9510546532543747 -0.3090227281660707 -3.0776204031933605 -0.324926361601448 null 1.5567127509720364 176 0.8414709848078965 0.5403023058681398 1.557407724654902 0.6420926159343308 0.0 0.7853981633974483 177 0.8414709848078965 0.5403023058681398 1.557407724654902 0.6420926159343308 0.0 0.7853981633974483 178 select sin(b), cos(b), tan(b),cot(b),acos(b),atan(b) from t1; 179 sin(b) cos(b) tan(b) cot(b) acos(b) atan(b) 180 0.8414709848078965 0.5403023058681398 1.557407724654902 0.6420926159343308 0.0 0.7853981633974483 181 0.8414709848078965 0.5403023058681398 1.557407724654902 0.6420926159343308 0.0 0.7853981633974483 182 0.8414709848078965 0.5403023058681398 1.557407724654902 0.6420926159343308 0.0 0.7853981633974483 183 0.9510546532543747 -0.3090227281660707 -3.0776204031933605 -0.324926361601448 null 1.5567127509720364 184 select sin(c), cos(c), tan(c),cot(c),acos(c),atan(c) from t1; 185 sin(c) cos(c) tan(c) cot(c) acos(c) atan(c) 186 0.9092974268256817 -0.4161468365471424 -2.185039863261519 -0.45765755436028577 null 1.1071487177940906 187 0.9092974268256817 -0.4161468365471424 -2.185039863261519 -0.45765755436028577 null 1.1071487177940906 188 0.836655638536056 -0.5477292602242684 -1.527498527636603 -0.6546651154860578 null 1.5232132235179132 189 0.9092974268256817 -0.4161468365471424 -2.185039863261519 -0.45765755436028577 null 1.1071487177940906 190 select sin(d), cos(d), tan(d),cot(d),acos(d),atan(d) from t1; 191 sin(d) cos(d) tan(d) cot(d) acos(d) atan(d) 192 -0.8317747426285983 0.5551133015206257 -1.4983873388551707 -0.6673841763532525 null 1.5475447039844337 193 0.5290826861200238 -0.8485702747846052 -0.6234989627162255 -1.6038519064146899 null 1.5413930385908916 194 -0.7568024953079283 -0.6536436208636119 1.1578212823495775 0.8636911544506167 null 1.3258176636680326 195 0.5290826861200238 -0.8485702747846052 -0.6234989627162255 -1.6038519064146899 null 1.5413930385908916 196 select sin(e), cos(e), tan(e),cot(e),acos(e),atan(e) from t1; 197 sin(e) cos(e) tan(e) cot(e) acos(e) atan(e) 198 -0.9589242746631385 0.28366218546322625 -3.380515006246585 -0.2958129155327456 null 1.373400766945016 199 -0.9589242746631385 0.28366218546322625 -3.380515006246585 -0.2958129155327456 null 1.373400766945016 200 -0.5587890488516163 -0.8293098328631502 0.6738001006480597 1.484119695200701 null 1.5522799247268875 201 -0.9589242746631385 0.28366218546322625 -3.380515006246585 -0.2958129155327456 null 1.373400766945016 202 select sin(f), cos(f), tan(f),cot(f),acos(f),atan(f) from t1; 203 sin(f) cos(f) tan(f) cot(f) acos(f) atan(f) 204 -0.8090187662119065 -0.587782813560387 1.3763906455709773 0.7265379223680812 null 1.5426347598070043 205 -0.7055403255703919 0.70866977429126 -0.995584052213885 -1.0044355348765333 null 1.3909428270024184 206 -0.09279121175730869 -0.9956855884367365 0.09319328594782049 10.730386742237057 null 1.5521069143479909 207 -0.7055403255703919 0.70866977429126 -0.995584052213885 -1.0044355348765333 null 1.3909428270024184 208 select sin(g), cos(g), tan(g),cot(g),acos(g),atan(g) from t1; 209 sin(g) cos(g) tan(g) cot(g) acos(g) atan(g) 210 -0.27916702435082624 0.960242559208404 -0.2907255272886086 -3.4396704318547213 null 1.5386871079895943 211 0.9645147349480212 -0.2640290250486648 -3.653063275032908 -0.27374286310192414 null 1.5678649014274997 212 -0.6682146725852425 -0.7439685150204929 0.8981760102668273 1.1133675232574105 null 1.5684768449526045 213 -0.10274490038158632 0.9947077387079976 -0.103291546233509 -9.681334402133174 null 1.5388715592334 214 select sin(h), cos(h), tan(h),cot(h),acos(h),atan(h) from t1; 215 sin(h) cos(h) tan(h) cot(h) acos(h) atan(h) 216 0.9844057342302103 -0.1759129057649856 -5.595983591706154 -0.17869959473828817 null 1.5010479781071044 217 0.3838510820599206 -0.923395011250022 -0.41569542544992977 -2.405607420186656 null 1.505589178172813 218 0.9671992895453196 -0.2540187676196956 -3.8075898824663335 -0.2626333273457116 null 1.5014343848467917 219 -0.9756589591814997 0.21929340019451712 -4.4491031573046556 -0.22476439962021863 null 1.5627523540210526 220 select sin(i), cos(i), tan(i),cot(i),acos(i),atan(i) from t1; 221 invalid argument function sin, bad value [DATE] 222 select sin(k), cos(k), tan(k),cot(k),acos(k),atan(k) from t1; 223 invalid argument function sin, bad value [DATETIME] 224 select sin(l), cos(l), tan(l),cot(l),acos(l),atan(l) from t1; 225 invalid argument function sin, bad value [TIMESTAMP] 226 drop table t1; 227 Create table t1(a float); 228 insert into t1 select (sin(1)); 229 insert into t1 select (cos(1)); 230 insert into t1 select (tan(1)); 231 insert into t1 select (cot(1)); 232 insert into t1 select (acos(1)); 233 insert into t1 select (atan(1)); 234 insert into t1 select (sin(1)); 235 insert into t1 select (cos(1)); 236 insert into t1 select (tan(1)); 237 insert into t1 select (cot(1)); 238 insert into t1 select (acos(1)); 239 insert into t1 select (atan(1)); 240 select distinct sin(a) from t1; 241 sin(a) 242 0.7456241230036048 243 0.5143952334342761 244 0.9999103741675135 245 0.5988726343417219 246 0.0 247 0.7071067966408575 248 select distinct cos(a) from t1; 249 cos(a) 250 0.6663667662744783 251 0.8575532308959583 252 0.01338819002640532 253 0.8008442843877993 254 1.0 255 0.7071067657322372 256 select distinct tan(a) from t1; 257 tan(a) 258 1.118939540115781 259 0.5998405870348642 260 74.6860010348976 261 0.747801596410876 262 0.0 263 1.0000000437113907 264 select distinct acos(a) from t1; 265 acos(a) 266 0.5707963786279666 267 1.0000000347686513 268 null 269 0.873571492828528 270 1.5707963267948966 271 0.667457180719794 272 select distinct atan(a) from t1; 273 atan(a) 274 0.6995216279525449 275 0.4953672665727952 276 1.00000000353913 277 0.5707963474946961 278 0.0 279 0.6657737635458051 280 drop table t1; 281 drop table if exists t1; 282 create table t1(a INT, b float); 283 insert into t1 values(1, 0),(0, 1),(1,1),(0,0); 284 select * from t1 where sin(a)<>cos(b); 285 a b 286 1 0.0 287 0 1.0 288 1 1.0 289 0 0.0 290 select * from t1 where sin(b)<>cos(a); 291 a b 292 1 0.0 293 0 1.0 294 1 1.0 295 0 0.0 296 select * from t1 where tan(b)<>cot(a-0.5); 297 a b 298 1 0.0 299 0 1.0 300 1 1.0 301 0 0.0 302 select * from t1 where atan(b)<>acos(a); 303 a b 304 0 1.0 305 1 1.0 306 0 0.0 307 drop table t1; 308 create table t1(a INT, b float); 309 create table t2(a INT, b float); 310 insert into t1 values(1, 0),(0, 1),(1,1),(0,0); 311 insert into t2 values(0, 1),(1, 0),(1,1),(0,0); 312 SELECT t1.a, t2.a FROM t1 JOIN t2 ON (sin(t1.a)=sin(t2.b)); 313 a a 314 1 0 315 1 0 316 0 1 317 0 1 318 1 1 319 1 1 320 0 0 321 0 0 322 SELECT t1.a, t2.a FROM t1 JOIN t2 ON (cos(t1.a)=cos(t2.b)); 323 a a 324 1 0 325 1 0 326 0 1 327 0 1 328 1 1 329 1 1 330 0 0 331 0 0 332 SELECT t1.a, t2.a FROM t1 JOIN t2 ON (tan(t1.a)=tan(t2.b)); 333 a a 334 1 0 335 1 0 336 0 1 337 0 1 338 1 1 339 1 1 340 0 0 341 0 0 342 SELECT t1.a, t2.a FROM t1 JOIN t2 ON (cot(t1.a-0.5)=cot(t2.b-0.5)); 343 a a 344 1 0 345 1 0 346 0 1 347 0 1 348 1 1 349 1 1 350 0 0 351 0 0 352 SELECT t1.a, t2.a FROM t1 JOIN t2 ON (acos(t1.a)=acos(t2.b)); 353 a a 354 1 0 355 1 0 356 0 1 357 0 1 358 1 1 359 1 1 360 0 0 361 0 0 362 SELECT t1.a, t2.a FROM t1 JOIN t2 ON (atan(t1.a)=atan(t2.b)); 363 a a 364 1 0 365 1 0 366 0 1 367 0 1 368 1 1 369 1 1 370 0 0 371 0 0 372 drop table t1; 373 drop table t2; 374 drop table if exists t1; 375 create table t1(a INT, b float); 376 insert into t1 values(1, 0),(0, 1),(1,1),(0,0); 377 SELECT a FROM t1 group by a having sin(a)>0; 378 a 379 1 380 SELECT a FROM t1 group by a having cos(a)>0; 381 a 382 1 383 0 384 SELECT a FROM t1 group by a having tan(a)>0; 385 a 386 1 387 SELECT a FROM t1 group by a having cot(a-0.5)>0; 388 a 389 1 390 SELECT a FROM t1 group by a having acos(a)>0; 391 a 392 0 393 SELECT a FROM t1 group by a having atan(a)>0; 394 a 395 1 396 drop table t1; 397 SELECT sin(0.745e5); 398 sin(0.745e5) 399 0.2684780940249433 400 SELECT cos(1.1e5); 401 cos(1.1e5) 402 0.962472104675665 403 SELECT tan(1.1e5); 404 tan(1.1e5) 405 0.28196207581277094 406 SELECT cot(0.7e5); 407 cot(0.7e5) 408 -0.6889761663667616 409 SELECT acos(1.1e5); 410 acos(1.1e5) 411 null 412 SELECT atan(1.1e5); 413 atan(1.1e5) 414 1.570787235885806