いろは3010814 views
中学数学623755 views
高校国語788336 views
中学社会668760 views
高校化学2924392 views
中学英語811710 views
りんご209490 views
世界の国564520 views
小学算数1200427 views
MathPython497343 views
Help
Tools
NewsSpreadsheetCalendarSlidesTier ListPen ToolIllustrationCrayonPixel ArtASCII ArtPerspectiveEndless StairsGraphMind MapER DiagramFamily TreeMemeCurved TextImage EditorMosaicRetro FilterPencil SketchOCR/HighlighterMakeup EditorFaviconVideo TrimmerScrolling VideoVideo TitleColor PickerColor ExtractorBonfireFireworksWater RippleWater SplashBreaking GlassWood GrainMarble TextureCSS ButtonIcon MakerBar ChartGrouped Bar ChartStacked Bar ChartPie ChartLine ChartArea ChartStacked Area ChartScatter Plot3D Bar Chart3D Pie ChartBar Chart RaceBubble ChartPopulation PyramidPictogramEarningsCandlestick ChartInvestment RiskMortgage SimulatorCalculatorMatrix CalculatorFunction GraphPolynomial ExpansionVenn DiagramField VisualizerRubik's Cube Group TheoryTraveling SalesmanVoronoi and DelaunayFractalColumn ArithmeticDraw Math FiguresArithmetic AnimationArithmetic Word ProblemsCounting with Tree DiagramsCube NetsCross SectionsMotion PathMechanicsWavesLight and LensesThermodynamicsHow Semiconductors WorkMolecular StructuresAtomic OrbitalsElectrochemical CellsChemical EquilibriumCrystal LatticesBuffer pHComplex IonsDNA Double HelixCell DivisionMembrane ChannelsNerve ImpulseRock ClassificationWeatherConstellationsSolar and Lunar Eclipses3D ModelingFloor PlanSeismic StructuresIntersection TurnMaglevCooking AnimationOrigamiLive Viewer CountGeoJSON MapRailway MapPopulation MapCrime MapLand Price MapSchool MapShrine and Castle MapHouse of Representatives MapWord MapSolitaireReversiHakoiri MusumeChessHamburgerRippleSlide Puzzle MakerNeon PinballNovel MakerJapanese Typing PracticePiano Score EditorMusic Theory

English

LaTeX の床関数・天井関数

床関数(floor)と天井関数(ceiling)は、実数を整数に変換する関数です。LaTeX では専用の括弧記号を使って表記します。

床関数

床関数 は、 以下の最大の整数を返します。\lfloor\rfloor を使います。

\lfloor 3.7 \rfloor = 3

負の数の場合、 となる点に注意してください(小さい方の整数)。

天井関数

天井関数 は、 以上の最小の整数を返します。\lceil\rceil を使います。

\lceil 3.2 \rceil = 4

記号の覚え方

関数覚え方
\lfloor\rfloorfloor の f、下が閉じている
天井\lceil\rceilceiling の c、上が閉じている

床関数は「床」なので下側が平ら、天井関数は「天井」なので上側が平らと覚えると忘れにくいです。

\left \right との組み合わせ

中身が大きい場合は自動調整を使います。

\left\lfloor \frac{n}{2} \right\rfloor

実用例

アルゴリズムや計算機科学でよく登場します。例えば、配列の中央インデックスを求める式は次のように書けます。

\text{mid} = \left\lfloor \frac{\text{left} + \text{right}}{2} \right\rfloor

床関数・天井関数は離散数学やプログラミングの文脈で頻出するので、記号を覚えておくと便利です。