2,951
edits
No edit summary |
(→Documentation: BQN) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Built-in|Ceiling|⌈}} is a [[monadic]] [[scalar function]] | {{Built-in|Ceiling|⌈}} is a [[monadic]] [[scalar function]] that gives the [[wikipedia:floor and ceiling functions|ceiling]] of a real number, that is, the least integer [[Comparison tolerance|tolerantly]] [[greater than or equal to]] the given value. This operation is also known as '''round up'''. Ceiling shares the [[glyph]] <source lang=apl inline>⌈</source> with the dyadic arithmetic function [[Maximum]]. [[Comparison_with_traditional_mathematics#Prefix|Traditional mathematics]] derives [[Ken_Iverson#Floor_and_Ceiling|its notation]] and name for ceiling from APL. | ||
== Examples == | == Examples == | ||
Line 18: | Line 18: | ||
<source lang=apl> | <source lang=apl> | ||
⎕PP←16 | ⎕PP←16 | ||
⎕←v←1+0.6×⎕CT×0 1 2 | |||
1 1.000000000000006 1.000000000000012 | 1 1.000000000000006 1.000000000000012 | ||
⌈v | ⌈v | ||
Line 46: | Line 46: | ||
=== Documentation === | === Documentation === | ||
* [ | * [https://help.dyalog.com/latest/#Language/Primitive%20Functions/Ceiling.htm Dyalog] | ||
* [http://microapl.com/apl_help/ch_020_020_090.htm APLX] | * [http://microapl.com/apl_help/ch_020_020_090.htm APLX] | ||
* [https://www.jsoftware.com/help/dictionary/d021.htm J Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/gtdot NuVoc] | * [https://www.jsoftware.com/help/dictionary/d021.htm J Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/gtdot NuVoc] | ||
* [https://mlochbaum.github.io/BQN/doc/arithmetic.html#additional-arithmetic BQN] | |||
{{APL built-ins}}[[Category:Primitive functions]][[Category:Scalar monadic functions]] | {{APL built-ins}}[[Category:Primitive functions]][[Category:Scalar monadic functions]] |