Renderingen-US

Experimental through version 1. Version 0 was alpha. This is the first language release: the interface is relatively stable, not frozen. Nothing is promised stable until version 2.

⌊x⌉

Translation status: English reader-locale proof. Term names and code fences follow the en pack; supporting prose may still be English.

Rounding glyphs: floor, ceiling, and nearest with ties to the even neighbour.

Syntax: ⌊x⌋ floor | ⌈x⌉ ceiling | ⌊x⌉ nearest (ties to even)

Category#

arithmetic

Examples#

radix/corpus/operatores/rounding-glyphs-la.fab (canonical · operator-group)#

Signa rotundandi: pavimentum, tectum, proximum cum paribus call parem.

# =============================================================================
# ⌊x⌉ — Rounding glyphs in the Latin surface.
# =============================================================================
#
# What this teaches:
#   • The same three glyphs in every locale; nearest sends ties to even.
#
# See also: ⌊x⌋, ⌈x⌉
# =============================================================================

# EXPECTED OUTPUT:
#   2, 3, 2, 4, -2, 2, 3

main {
    let float dimidium ← 2.5
    print ⌊dimidium⌋
    print ⌈dimidium⌉
    print ⌊dimidium⌉
    print ⌊3.5⌉
    print ⌊-2.5⌉
    print ⌊2.4⌉
    print ⌊2.6⌉
}

Expected output:

2
3
2
4
-2
2
3

radix/corpus/operatores/rounding-glyphs.fab (canonical · operator-group)#

Rounding glyphs: floor, ceiling, and nearest with ties to the even neighbour.

# =============================================================================
# ⌊x⌉ — Rounding glyphs: floor, ceiling, and nearest with ties to even.
# =============================================================================
#
# What this teaches:
#   • `⌊x⌋` floor, `⌈x⌉` ceiling, `⌊x⌉` nearest.
#   • Nearest sends a tie to the even neighbour: `⌊2.5⌉` is 2, `⌊3.5⌉` is 4.
#
# Common mistakes:
#   • Writing `⌈x⌋` — it is a named error; write `⌊x⌉` for nearest.
#
# See also: ⌊x⌋, ⌈x⌉
# =============================================================================

# EXPECTED OUTPUT:
#   2, 3, 2, 4, -2, 2, 3

main {
    let float half ← 2.5
    print ⌊half⌋
    print ⌈half⌉
    print ⌊half⌉
    print ⌊3.5⌉
    print ⌊-2.5⌉
    print ⌊2.4⌉
    print ⌊2.6⌉
}

Expected output:

2
3
2
4
-2
2
3