all repos — min @ 966cf2c24f7962d590c7348eca71e6dff2593727

A small but practical concatenative programming language.

Documented num module.
h3rald h3rald@h3rald.com
Sat, 08 Jul 2017 14:05:19 +0200
commit

966cf2c24f7962d590c7348eca71e6dff2593727

parent

996faf9cc2427664e60016010e3a958f886b0130

2 files changed, 42 insertions(+), 1 deletions(-)

jump to
M site/contents/_includes/_defs_.mdsite/contents/_includes/_defs_.md

@@ -15,7 +15,11 @@ {{flt => [float](class:kwd)}}

{{i => [int](class:kwd)}} {{i1 => [a<sub>1</sub>](class:kwd)}} {{i2 => [a<sub>2</sub>](class:kwd)}} +{{i3 => [a<sub>3</sub>](class:kwd)}} {{n => [num](class:kwd)}} +{{n1 => [num<sub>1</sub>](class:kwd)}} +{{n2 => [num<sub>2</sub>](class:kwd)}} +{{n3 => [num<sub>3</sub>](class:kwd)}} {{any => [a](class:kwd)}} {{a1 => [a<sub>1</sub>](class:kwd)}} {{a2 => [a<sub>2</sub>](class:kwd)}}
M site/contents/_includes/_reference-num.mdsite/contents/_includes/_reference-num.md

@@ -1,1 +1,38 @@

-... +{@ _defs_.md || 0 @} + + +{#op||+||{{n1}} {{n2}}||{{n3}}|| +Sums {{n1}} and {{n2}}. #} + +{#op||-||{{n1}} {{n2}}||{{n3}}|| +Subtracts {{n2}} from {{n1}}. #} + +{#op||\*||{{n1}} {{n2}}||{{n3}}|| +Multiplies {{n1}} by {{n2}}. #} + +{#op||/||{{n1}} {{n2}}||{{n3}}|| +Divides {{n1}} by {{n2}}. #} + +{#op||even?||{{i}}||{{b}}|| +Returns **true** if {{i}} is even, **false** otherwise. #} + +{#op||div||{{i1}} {{i2}}||{{i3}}|| +Divides {{i1}} by {{i2}} (integer division). #} + +{#op||mod||{{i1}} {{i2}}||{{i3}}|| +Returns the integer module of {{i1}} divided by {{i2}}. #} + +{#op||odd?||{{i}}||{{b}}|| +Returns **true** if {{i}} is odd, **false** otherwise. #} + +{#op||pred||{{i1}}||{{i2}}|| +Returns the predecessor of {{i1}}.#} + +{#op||random||{{i1}}||{{i2}}|| +Returns a random number {{i2}} between 0 and {{i1}}-1. #} + +{#op||succ||{{i1}}||{{i2}}|| +Returns the successor of {{i1}}.#} + +{#op||sum||{{q}}||{{i}}|| +Returns the sum of all items of {{q}}. {{q}} is a quotation of integers. #}