¾�ΥС�������ʸ�� �� 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9.6 | 9.5 | 9.4 | 9.3 | 9.2 | 9.1 | 9.0 | 8.4 | 8.3 | 8.2 | 8.1 | 8.0 | 7.4 | 7.3 | 7.2

9.3. ���Ѵؿ��ȱ黻��

PostgreSQL�ο�¿���η����Ф��뻻�ѱ黻�Ҥ��Ѱդ���Ƥ��ޤ���ɸ�໻��ɽ��ˡ�˽���ʤ������㤨�С�����/����ǡ������ˤˤĤ��Ƥϡ���³������Ǽºݤ�ư����������ޤ���

表9-2�ϻ��Ѳ�ǽ�ʻ��ѱ黻�Ҥ򼨤��Ƥ��ޤ���

表 9-2. ���ѱ黻��

�黻��̾���������
+ ��2 + 35
- ��2 - 3-1
* ��2 * 36
/ ���������γ�껻�Ǥ�;����ڤ�Τơ�4 / 22
% ��;��;���5 % 41
^ �߾�2.0 ^ 3.08
|/ ʿ����|/ 25.05
||/ ����||/ 27.03
! ����5 !120
!! ��������ֱ黻�ҡ�!! 5120
@ ������@ -5.05
& �Х��ʥ��AND91 & 1511
| �Х��ʥ��OR32 | 335
# �Х��ʥ��XOR17 # 520
~ �Х��ʥ��NOT~1-2
<< �Х��ʥ�κ����ե�1 << 416
>> �Х��ʥ�α����ե�8 >> 22

�Х��ʥ�黻�Ҥ������ǡ������Τߤ˻��ѤǤ��ޤ�������¾�α黻�Ҥ����Ƥο��ͥǡ������˻��ѤǤ��ޤ����ޤ����Х��ʥ�黻�Ҥ�表9-10�˼�����bit��bit varying�ӥå�ʸ���󷿤��Ф��Ƥ���Ѥ��뤳�Ȥ��Ǥ��ޤ���

表9-3�˻��Ѳ�ǽ�ʻ��Ѵؿ��򼨤��ޤ��� ����ɽ���dp�ϡ�double precision���̣���ޤ��������ؿ���¿���ϡ��ۤʤ�����������ʣ���η����󶡤���Ƥ��ޤ������̤ʾ������������Ǥ�շ����δؿ��Ϥ��ΰ�����Ʊ���ǡ��������֤��ޤ���double precision�ǡ������Ф���ؿ��ΤۤȤ�ɤϥۥ��ȥ����ƥ��C�饤�֥��ξ��ؤ˼�������Ƥ��ޤ������Τ��ᡢ�����᤯�ξ������٤ȿ��񤤤ϥۥ��ȥ����ƥ�˰�¸�����Ѥ��ޤ���

表 9-3. ���Ѵؿ�

�ؿ�����ͷ����������
abs(x) �����Ϥ�Ʊ����������abs(-17.4)17.4
cbrt(dp) dp����cbrt(27.0)3
ceil(dp or numeric) �����Ϸ���Ʊ���������꾮�����ʤ��Ǿ�������ceil(-42.8)-42
ceiling(dp or numeric) �����Ϸ���Ʊ���������꾮�����ʤ��Ǿ���������ceil����̾��ceiling(-95.3)-95
degrees(dp) dp�饸������б�������degrees(0.5)28.6478897565412
div(y numeric, x numeric) numericy/x��������div(9,4)2
exp(dp or numeric) �����Ϸ���Ʊ����ؿ�exp(1.0)2.71828182845905
floor(dp or numeric) �����Ϸ���Ʊ�����������礭���ʤ����������floor(-42.8)-43
ln(dp or numeric) �����Ϸ���Ʊ��������п�ln(2.0)0.693147180559945
log(dp or numeric) �����Ϸ���Ʊ���10����Ȥ����п��ʾ����п���log(100.0)2
log(b numeric, x numeric)numericb����Ȥ����п�log(2.0, 64.0)6.0000000000
mod(y, x) �ʰ����η���Ʊ���y/x�ξ�;mod(9,4)1
pi() dp"�߼�Ψ�ʦС�"���pi()3.14159265358979
power(a dp, b dp) dpa��b��power(9.0, 3.0)729
power(a numeric, b numeric)numerica��b��power(9.0, 3.0)729
radians(dp) dp�٤��б�����饸����radians(45.0)0.785398163397448
random() dp0.0 <= x < 1.0���ϰϤ������random() 
round(dp or numeric) �����Ϸ���Ʊ����ͼθ���round(42.4)42
round(v numeric, s int)numeric������s�ΰ̤ޤǻͼθ��������ڼΤ�round(42.4382, 2)42.44
setseed(dp) void�����random()�ƤӽФ��ǻ��Ѥ���륷����(��)�������-1.0����1.0�ޤǤζ�����ޤ��͡�setseed(0.54823) 
sign(dp or numeric) �����Ϸ���Ʊ�������������-1��0��+1��sign(-8.4)-1
sqrt(dp or numeric) �����Ϸ���Ʊ���ʿ����sqrt(2.0)1.4142135623731
trunc(dp or numeric) �����Ϸ���Ʊ����ڤ�Τ�trunc(42.8)42
trunc(v numeric, s int)numerics�η���ڤ�Τ�trunc(42.4382, 2)42.43
width_bucket(op numeric, b1 numeric, b2 numeric, count int) intoperand��������Ƥ��롢b1����b2�ޤǤΥХ��åȿ�count�������٥ҥ��ȥ����ΥХ��åȤ��֤�width_bucket(5.35, 0.024, 10.06, 5)3
width_bucket(op dp, b1 dp, b2 dp, count int)int operand��������Ƥ��롢b1����b2�ޤǤΥХ��åȿ�count�������٥ҥ��ȥ����ΥХ��åȤ��֤� width_bucket(5.35, 0.024, 10.06, 5)3

�Ǹ�ˡ����Ѳ�ǽ�ʻ��Ѵؿ���表9-4�˼����ޤ������Ƥλ��Ѵؿ���double precision�ǡ������ΰ���������ͤ���ޤ������Ѵؿ��ΰ����ϥ饸�����ɽ����ޤ����մؿ����֤��ͤϥ饸�����ɽ����ޤ����嵭��radians()��degrees()�Ȥ��ä�ñ���Ѵ��ؿ��򻲾Ȥ��Ʋ�������

表 9-4. ���Ѵؿ�

�ؿ�����
acos(x) ��;���ؿ�
asin(x) �������ؿ�
atan(x) �����ܴؿ�
atan2(y, x) y/x�ε����ܴؿ�
cos(x) ;���ؿ�
cot(x) ;�ܴؿ�
sin(x) �����ؿ�
tan(x) ���ܴؿ�