Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
f78ec279
Commit
f78ec279
authored
Aug 11, 2004
by
lenz@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- fixed non-predictable floating point results in func_math by adding
format() around them (as suggested by serg)
parent
343e0314
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
mysql-test/r/func_math.result
mysql-test/r/func_math.result
+3
-3
mysql-test/t/func_math.test
mysql-test/t/func_math.test
+1
-1
No files found.
mysql-test/r/func_math.result
View file @
f78ec279
...
...
@@ -35,9 +35,9 @@ set @@rand_seed1=10000000,@@rand_seed2=1000000;
select rand(999999),rand();
rand(999999) rand()
0.014231365187309 0.028870999839968
select pi(),
sin(pi()/2),cos(pi()/2),abs(tan(pi())),cot(1),asin(1),acos(0),atan(1
);
pi()
sin(pi()/2) cos(pi()/2) abs(tan(pi())) cot(1) asin(1) acos(0) atan(1
)
3.141593 1
6.1230317691119e-17 1.2246063538224e-16 0.64209261593433 1.5707963267949 1.5707963267949 0.78539816339745
select pi(),
format(sin(pi()/2),6),format(cos(pi()/2),6),format(abs(tan(pi())),6),format(cot(1),6),format(asin(1),6),format(acos(0),6),format(atan(1),6
);
pi()
format(sin(pi()/2),6) format(cos(pi()/2),6) format(abs(tan(pi())),6) format(cot(1),6) format(asin(1),6) format(acos(0),6) format(atan(1),6
)
3.141593 1
.000000 0.000000 0.000000 0.642093 1.570796 1.570796 0.785398
select degrees(pi()),radians(360);
degrees(pi()) radians(360)
180 6.2831853071796
...
...
mysql-test/t/func_math.test
View file @
f78ec279
...
...
@@ -15,7 +15,7 @@ select log10(100),log10(18),log10(-4),log10(0),log10(NULL);
select
pow
(
10
,
log10
(
10
)),
power
(
2
,
4
);
set
@@
rand_seed1
=
10000000
,
@@
rand_seed2
=
1000000
;
select
rand
(
999999
),
rand
();
select
pi
(),
sin
(
pi
()
/
2
),
cos
(
pi
()
/
2
),
abs
(
tan
(
pi
())),
cot
(
1
),
asin
(
1
),
acos
(
0
),
atan
(
1
);
select
pi
(),
format
(
sin
(
pi
()
/
2
),
6
),
format
(
cos
(
pi
()
/
2
),
6
),
format
(
abs
(
tan
(
pi
())),
6
),
format
(
cot
(
1
),
6
),
format
(
asin
(
1
),
6
),
format
(
acos
(
0
),
6
),
format
(
atan
(
1
),
6
);
select
degrees
(
pi
()),
radians
(
360
);
#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment