~drizzle-pbxt/drizzle/drizzle-pbxt-2

« back to all changes in this revision

Viewing changes to tests/r/func_math.result

  • Committer: Paul McCullagh
  • Date: 2009-11-10 14:18:39 UTC
  • mfrom: (1038.1.7 drizzle-pbxt-pre-merge)
  • Revision ID: paul.mccullagh@primebase.org-20091110141839-2j3k43b17ag6f605
Merged Drizzle trunk and PBXT 1.0.09

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
Note    1003    select abs(-(10)) AS `abs(-10)`,sign(-(5)) AS `sign(-5)`,sign(5) AS `sign(5)`,sign(0) AS `sign(0)`
45
45
select log(exp(10)),exp(log(sqrt(10))*2),log(-1),log(NULL),log(1,1),log(3,9),log(-1,2),log(NULL,2);
46
46
log(exp(10))    exp(log(sqrt(10))*2)    log(-1) log(NULL)       log(1,1)        log(3,9)        log(-1,2)       log(NULL,2)
47
 
10      10.000000000000002      NULL    NULL    NULL    2       NULL    NULL
 
47
10      10      NULL    NULL    NULL    2       NULL    NULL
48
48
Warnings:
49
49
Error   1365    Division by 0
50
50
Error   1365    Division by 0
56
56
Note    1003    select log(exp(10)) AS `log(exp(10))`,exp((log(sqrt(10)) * 2)) AS `exp(log(sqrt(10))*2)`,log(-(1)) AS `log(-1)`,log(NULL) AS `log(NULL)`,log(1,1) AS `log(1,1)`,log(3,9) AS `log(3,9)`,log(-(1),2) AS `log(-1,2)`,log(NULL,2) AS `log(NULL,2)`
57
57
select ln(exp(10)),exp(ln(sqrt(10))*2),ln(-1),ln(0),ln(NULL);
58
58
ln(exp(10))     exp(ln(sqrt(10))*2)     ln(-1)  ln(0)   ln(NULL)
59
 
10      10.000000000000002      NULL    NULL    NULL
 
59
10      10      NULL    NULL    NULL
60
60
Warnings:
61
61
Error   1365    Division by 0
62
62
Error   1365    Division by 0
67
67
Note    1003    select ln(exp(10)) AS `ln(exp(10))`,exp((ln(sqrt(10)) * 2)) AS `exp(ln(sqrt(10))*2)`,ln(-(1)) AS `ln(-1)`,ln(0) AS `ln(0)`,ln(NULL) AS `ln(NULL)`
68
68
select log2(8),log2(15),log2(-2),log2(0),log2(NULL);
69
69
log2(8) log2(15)        log2(-2)        log2(0) log2(NULL)
70
 
3       3.9068905956085187      NULL    NULL    NULL
 
70
3       3.90689059560852        NULL    NULL    NULL
71
71
Warnings:
72
72
Error   1365    Division by 0
73
73
Error   1365    Division by 0
78
78
Note    1003    select log2(8) AS `log2(8)`,log2(15) AS `log2(15)`,log2(-(2)) AS `log2(-2)`,log2(0) AS `log2(0)`,log2(NULL) AS `log2(NULL)`
79
79
select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
80
80
log10(100)      log10(18)       log10(-4)       log10(0)        log10(NULL)
81
 
2       1.255272505103306       NULL    NULL    NULL
 
81
2       1.25527250510331        NULL    NULL    NULL
82
82
Warnings:
83
83
Error   1365    Division by 0
84
84
Error   1365    Division by 0
110
110
Note    1003    select pi() AS `pi()`,format(sin((pi() / 2)),6) AS `format(sin(pi()/2),6)`,format(cos((pi() / 2)),6) AS `format(cos(pi()/2),6)`,format(abs(tan(pi())),6) AS `format(abs(tan(pi())),6)`,format((1 / tan(1)),6) AS `format(cot(1),6)`,format(asin(1),6) AS `format(asin(1),6)`,format(acos(0),6) AS `format(acos(0),6)`,format(atan(1),6) AS `format(atan(1),6)`
111
111
select degrees(pi()),radians(360);
112
112
degrees(pi())   radians(360)
113
 
180     6.283185307179586
 
113
180     6.28318530717959
114
114
select format(atan(-2, 2), 6);
115
115
format(atan(-2, 2), 6)
116
116
-0.785398
128
128
0
129
129
SELECT ASIN(1.0);
130
130
ASIN(1.0)
131
 
1.5707963267948966
 
131
1.5707963267949
132
132
SELECT ACOS(0.2*5.0);
133
133
ACOS(0.2*5.0)
134
134
0
137
137
0
138
138
SELECT ASIN(0.8+0.2);
139
139
ASIN(0.8+0.2)
140
 
1.5707963267948966
 
140
1.5707963267949
141
141
SELECT ASIN(1.2-0.2);
142
142
ASIN(1.2-0.2)
143
 
1.5707963267948966
 
143
1.5707963267949
144
144
select format(4.55, 1), format(4.551, 1);
145
145
format(4.55, 1) format(4.551, 1)
146
146
4.6     4.6
187
187
INSERT INTO t1 VALUES (1),(1),(1),(2);
188
188
SELECT RAND(2) * 1000, RAND(a) * 1000 FROM t1;
189
189
RAND(2) * 1000  RAND(a) * 1000
190
 
655.5866465490186       405.40353712197725
191
 
122.34661925802624      405.40353712197725
192
 
644.97318737672 405.40353712197725
193
 
857.8261098431667       655.5866465490186
 
190
655.586646549019        405.403537121977
 
191
122.346619258026        405.403537121977
 
192
644.97318737672 405.403537121977
 
193
857.826109843167        655.586646549019
194
194
SELECT RAND(2) * 1000, RAND(a) * 1000 FROM t1 WHERE a = 1;
195
195
RAND(2) * 1000  RAND(a) * 1000
196
 
655.5866465490186       405.40353712197725
197
 
122.34661925802624      405.40353712197725
198
 
644.97318737672 405.40353712197725
 
196
655.586646549019        405.403537121977
 
197
122.346619258026        405.403537121977
 
198
644.97318737672 405.403537121977
199
199
INSERT INTO t1 VALUES (3);
200
200
SELECT RAND(2) * 1000, RAND(a) * 1000 FROM t1;
201
201
RAND(2) * 1000  RAND(a) * 1000
202
 
655.5866465490186       405.40353712197725
203
 
122.34661925802624      405.40353712197725
204
 
644.97318737672 405.40353712197725
205
 
857.8261098431667       655.5866465490186
206
 
354.21101781931804      905.7697559760601
 
202
655.586646549019        405.403537121977
 
203
122.346619258026        405.403537121977
 
204
644.97318737672 405.403537121977
 
205
857.826109843167        655.586646549019
 
206
354.211017819318        905.76975597606
207
207
SELECT RAND(2) * 1000, RAND(a) * 1000 FROM t1 WHERE a = 1;
208
208
RAND(2) * 1000  RAND(a) * 1000
209
 
655.5866465490186       405.40353712197725
210
 
122.34661925802624      405.40353712197725
211
 
644.97318737672 405.40353712197725
 
209
655.586646549019        405.403537121977
 
210
122.346619258026        405.403537121977
 
211
644.97318737672 405.403537121977
212
212
DROP TABLE t1;
213
213
select round(111,-10);
214
214
round(111,-10)
225
225
select truncate(15000111000111000155,-1);
226
226
truncate(15000111000111000155,-1)
227
227
15000111000111000150
228
 
create table t1
 
228
create TEMPORARY table t1
229
229
(f1 varchar(32) not null,
230
230
f2 int not null,
231
231
f3 int not null default '0')
232
232
engine=myisam;
233
233
insert into t1 values ('zombie',0,0),('gold',1,10000),('silver',2,10000);
234
 
create table t2
 
234
create TEMPORARY table t2
235
235
(f1 int not null,
236
236
f2 int not null,
237
237
f3 int not null)