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