4,494
edits
(Created page with "{{Built-in|Floor|⌊}} is a monadic scalar function which gives the floor of a real number, i.e. the greatest integer not exc...") |
m (Text replacement - "http://help.dyalog.com" to "https://help.dyalog.com") Tags: Mobile edit Mobile web edit |
||
(6 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{Built-in|Floor|⌊}} is a [[monadic]] [[scalar function]] | {{Built-in|Floor|⌊}} is a [[monadic]] [[scalar function]] that gives the [[wikipedia:floor and ceiling functions|floor]] of a real number, that is, the greatest integer [[Comparison tolerance|tolerantly]] [[less than or equal to]] the given value. This operation is also known as '''integral part''', '''entier''', and '''round down'''. Floor shares the [[glyph]] <source lang=apl inline>⌊</source> with the dyadic arithmetic function [[Minimum]]. [[Comparison_with_traditional_mathematics#Prefix|Traditional mathematics]] derives [[Ken_Iverson#Floor_and_Ceiling|its notation]] and name for floor from APL. | ||
== Examples == | == Examples == | ||
Line 32: | Line 32: | ||
<source lang=apl> | <source lang=apl> | ||
⎕PP←16 | ⎕PP←16 | ||
⎕←v←1+0.6×⎕CTׯ2 ¯1 0 | |||
0.999999999999988 0.999999999999994 1 | 0.999999999999988 0.999999999999994 1 | ||
⌊v | ⌊v | ||
Line 42: | Line 42: | ||
:''Main article: [[Complex Floor]]'' | :''Main article: [[Complex Floor]]'' | ||
[[Eugene McDonnell]] designed the domain extension of Floor to [[complex number|complex numbers]].<ref>McDonnell, Eugene. [https://www.jsoftware.com/papers/eem/complexfloor.htm "Complex Floor"].</ref> Complex floor maps every complex number to a [[wikipedia:Gaussian integer|Gaussian integer]]. It has an important property that the [[magnitude]] of [[subtract|difference]] between any complex number Z and its floor is [[less than]] 1. This extension is currently implemented in [[Dyalog APL]], [[J]], and [[NARS2000]]. | [[Eugene McDonnell]] designed the domain extension of Floor to [[complex number|complex numbers]].<ref>McDonnell, Eugene. [https://www.jsoftware.com/papers/eem/complexfloor.htm "Complex Floor"].</ref> Complex floor maps every complex number to a [[wikipedia:Gaussian integer|Gaussian integer]], a complex number whose real and imaginary parts are integers. It has an important property that the [[magnitude]] of [[subtract|difference]] between any complex number Z and its floor is [[less than]] 1. This extension is currently implemented in [[Dyalog APL]], [[J]], and [[NARS2000]], and is internally used to implement complex [[ceiling]], [[residue]], and [[GCD]]. | ||
<source lang=apl> | <source lang=apl> | ||
Line 56: | Line 56: | ||
=== Documentation === | === Documentation === | ||
* [ | * [https://help.dyalog.com/latest/#Language/Primitive%20Functions/Floor.htm Dyalog] | ||
* [http://microapl.com/apl_help/ch_020_020_110.htm APLX] | * [http://microapl.com/apl_help/ch_020_020_110.htm APLX] | ||
* [https://www.jsoftware.com/help/dictionary/d011.htm J Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/ltdot NuVoc] | * [https://www.jsoftware.com/help/dictionary/d011.htm J Dictionary], [https://code.jsoftware.com/wiki/Vocabulary/ltdot NuVoc] | ||
==References== | |||
<references/> | |||
{{APL built-ins}}[[Category:Primitive functions]][[Category:Scalar monadic functions]] | {{APL built-ins}}[[Category:Primitive functions]][[Category:Scalar monadic functions]] |