arithmetic
Phonétique
Traductions
Variantes
- arithmetics: Pluriel
Exemples
Quadratic Arithmetic Programs: from Zero to Hero
Source:medium.com
prepare() does the one-time work: normalize whitespace, segment(段) the text, apply(适用) glue(胶水) rules, measure(衡量) the segments(段) with canvas(帆布), and return an opaque(不透明) handle. layout() is the cheap hot path(路径) after that: pure(纯) arithmetic(算术) over cached widths.
Source:github.com
The simple special-purpose programming language that we are using here supports basic arithmetic (+, -, *, /), constant-power exponentiation (x**7 but not x**y) and variable assignment, which is powerful enough that you can theoretically do any computation inside of it (as long as the number of computational steps is bounded; no loops allowed).
Source:medium.com
pointer arithmetic tricks
Source:github.com
We can extend the language to support conditionals (eg. if x < 5: y = 7; else: y = 9) by converting them to an arithmetic form: y = 7 * (x < 5) + 9 * (x >= 5); though note that both “paths” of the conditional would need to be executed, and if you have many nested conditionals then this can lead to a large amount of overhead.
Source:medium.com