Uit Wikipedia, de vrije encyclopedie
De functie ceiling (soms ook ceilfunctie of ceil ; Eng. ceiling = plafond) is een van de wiskundige functies waarmee een reëel getal op een specifieke wijze wordt afgerond op een geheel getal . Met de ceilingfunctie wordt een getal naar boven afgerond. De ceiling van het getal
x
{\displaystyle x}
wordt geschreven als
⌈
x
⌉
{\displaystyle \lceil x\rceil \,}
.
De ceiling
⌈
x
⌉
{\displaystyle \lceil x\rceil }
van een reëel getal
x
{\displaystyle x}
is het kleinste gehele getal dat groter of gelijk is aan
x
{\displaystyle x}
. Dus:
⌈
x
⌉
=
min
{
n
∈
Z
∣
n
≥
x
}
{\displaystyle \lceil x\rceil =\min \,\{n\in \mathbb {Z} \mid n\geq x\}}
Of anders geformuleerd:
⌈
x
⌉
∈
Z
{\displaystyle \lceil x\rceil \in \mathbb {Z} \quad }
en
x
≤
⌈
x
⌉
<
x
+
1
{\displaystyle \quad x\leq \lceil x\rceil <x+1}
Dit houdt in dat
⌈
x
⌉
=
k
{\displaystyle \lceil x\rceil =k}
,
als voor het gehele getal
k
{\displaystyle k}
geldt:
k
−
1
<
x
≤
k
{\displaystyle k-1<x\leq k}
⌈
1
⌉
=
1
{\displaystyle \lceil 1\rceil =1}
⌈
1
,
25
⌉
=
2
{\displaystyle \lceil 1{,}25\rceil =2}
⌈
1
,
50
⌉
=
2
{\displaystyle \lceil 1{,}50\rceil =2}
⌈
1
,
75
⌉
=
2
{\displaystyle \lceil 1{,}75\rceil =2}
⌈
2
⌉
=
2
{\displaystyle \lceil 2\rceil =2}
⌈
2
,
25
⌉
=
3
{\displaystyle \lceil 2{,}25\rceil =3}
⌈
−
1
⌉
=
−
1
{\displaystyle \lceil -1\rceil =-1}
⌈
−
1
,
25
⌉
=
−
1
{\displaystyle \lceil -1{,}25\rceil =-1}
De ceilingfunctie staat in nauwe relatie tot de functies nint en floor .
Als
x
∉
Z
{\displaystyle x\notin \mathbb {Z} }
⌈
x
⌉
=
nint
(
x
+
1
2
)
=
⌊
x
+
1
⌋
{\displaystyle \lceil x\rceil =\operatorname {nint} (x+{\tfrac {1}{2}})=\lfloor x+1\rfloor }
Ook geldt:
⌈
−
x
⌉
=
−
⌊
x
⌋
{\displaystyle \lceil -x\rceil =-\lfloor x\rfloor }