@@ -25,23 +25,37 @@ An atom.
2525Source
2626------
2727
28− ++ add :: add
28+ ++ add
2929 ~/ %add
3030 |= [a=@ b=@]
3131 ^- @
3232 ?: =(0 a) b
3333 $(a (dec a), b +(b))
34−
34+::
3535Examples
3636--------
3737
3838 > (add 2 2)
3939 4
40+
4041 > (add 1 1.000.000)
4142 1.000.001
43+
4244 > (add 1.333 (mul 2 2))
4345 1.337
4446
47+ > `@`'a' ::`'a'` is an atom represented as a different data type.
48+ 97 We cast it to the aura `@` to see what its integer representation is.
49+ > (add 'a' 4)
50+ 101
51+ (add 'a' 'b')
52+ 195
53+
54+ > (add 0xc 0xf) ::`0xc` and `0xf` are of the hexadecimal soft atom type (`@ux`).
55+ 27
56+ > `@ux`(add 0xc 0xf)
57+ 0x1b
58+
4559***
4660### `++dec`
4761
@@ -62,7 +76,7 @@ An atom.
6276Source
6377------
6478
65− ++ dec :: decrement
79+ ++ dec
6680 ~/ %dec
6781 |= a=@
6882 ~_ leaf+"decrement-underflow"
@@ -71,16 +85,26 @@ Source
7185 |- ^- @
7286 ?: =(a +(b)) b
7387 $(b +(b))
74−
88+::
7589Examples
7690--------
7791
7892 > (dec 7)
7993 6
94+
8095 > (dec 0)
8196 ! decrement-underflow
8297 ! exit
8398
99+ > (dec 'b')
100+ 97
101+ > `@t`(dec 'b')
102+ 'a'
103+
104+ > (dec 0xc)
105+ 11
106+ > `@ux`(dec 0xc)
107+ 0xb
84108
85109
86110***
@@ -88,7 +112,7 @@ Examples
88112
89113Divide
90114
91−Computes `a` divided by `b`.
115+Computes `a` divided by `b`. Only a whole number, without the remainder, is produced.
92116
93117Accepts
94118-------
@@ -105,10 +129,9 @@ An atom.
105129Source
106130------
107131
108− ++ div :: divide
132+ ++ div
109133 ~/ %div
110134 |: [a=`@`1 b=`@`1]
111− :> quotient
112135 ^- @
113136 ~_ leaf+"divide-by-zero"
114137 ?< =(0 b)
@@ -117,477 +140,92 @@ Source
117140 ?: (lth a b) c
118141 $(a (sub a b), c +(c))
119142 ::
120−
121143Examples
122144--------
123145
124146 > (div 4 2)
125147 2
148+
126149 > (div 17 8)
127150 2
128− > (div 20 30)
129− 0
130−
131−
132−***
133−### `++gte`
134−
135−Greater-than/equal
136−
137−Tests whether `a` is greater than a number `b`.
138−
139−Accepts
140−-------
141−
142−`a` is an atom.
143−
144−`b` is an atom.
145−
146−Produces
147−--------
148−
149−A boolean.
150−
151−Source
152−------
153−
154− ++ gte :: greater-equal
155− ~/ %gte
156− |= [a=@ b=@]
157− ^- ?
158− !(lth a b)
159−
160−
161−Examples
162−--------
163−
164− > (gte 100 10)
165− %.y
166− > (gte 4 4)
167− %.y
168− > (gte 3 4)
169− %.n
170−
171−
172−
173−***
174−### `++gth`
175−
176−Greater-than
177−
178−Tests whether `a` is greater than `b`.
179−
180−Accepts
181−-------
182−
183−`a` is an atom.
184−
185−`b` is an atom.
186−
187−Produces
188−--------
189−
190−A boolean.
191−
192−Source
193−------
194−
195− ++ gth :: greater-than
196− ~/ %gth
197− |= [a=@ b=@]
198− ^- ?
199− !(lte a b)
200−
201−
202−
203−Examples
204−--------
205−
206− > (gth 'd' 'c')
207− %.y
208− > (gth ~h1 ~m61)
209− %.n
210−
211−
212−
213−***
214−### `++lte`
215−
216−Less-than/equal
217−
218−Tests whether `a` is less than or equal to `b`.
219−
220−Accepts
221−-------
222−
223−`a` is an atom.
224−
225−`b` is an atom.
226−
227−Produces
228−--------
229−
230−A boolean.
231−
232−Source
233−------
234−
235− ++ lte :: less-equal
236− ~/ %lte
237− |= [a=@ b=@]
238− |(=(a b) (lth a b))
239−
240− ::
241−
242−Examples
243−--------
244−
245− > (lte 4 5)
246− %.y
247− > (lte 5 4)
248− %.n
249− > (lte 5 5)
250− %.y
251− > (lte 0 0)
252− %.y
253−
254−
255−
256−***
257−### `++lth`
258−
259−Less-than
260−
261−Tests whether `a` is less than `b`.
262−
263−Accepts
264−-------
265−
266−`a` is an atom.
267−
268−`b` is an atom.
269−
270−Produces
271−--------
272−
273−A boolean.
274−
275−Source
276−------
277−
278− ++ lth :: less-than
279− ~/ %lth
280− |= [a=@ b=@]
281− ^- ?
282− ?& !=(a b)
283− |-
284− ?| =(0 a)
285− ?& !=(0 b)
286− $(a (dec a), b (dec b))
287− == == ==
288−
289−Examples
290−--------
291−
292− > (lth 4 5)
293− %.y
294− > (lth 5 4)
295− %.n
296− > (lth 5 5)
297− %.n
298− > (lth 5 0)
299− %.n
300−
301−
302−***
303−### `++max`
304−
305−Maximum
306−
307−Computes the greater of `a` and `b`.
308−
309−Accepts
310−-------
311−
312−`a` is an atom.
313151
314−`b` is an atom.
315−
316−Produces
317−--------
318−
319−An atom.
320−
321−Source
322−------
323−
324− ++ max :: maximum
325− ~/ %max
326− |= [a=@ b=@]
327− ^- @
328− ?: (gth a b) a
329− b
330−
331−Examples
332−--------
333−
334− > (max 10 100)
335− 100
336− > (max 10.443 9)
337− 10.443
338− > (max 0 1)
339− 1
340−
341−
342−
343−***
344−### `++min`
345−
346−Minimum
347−
348−Computes the lesser of `a` and `b`.
349−
350−Accepts
351−-------
352−
353−`a` is an atom.
354−
355−`b` is an atom.
356−
357−Produces
358−--------
359−
360−An atom.
361−
362−Source
363−------
364−
365− ++ min :: minimum
366− ~/ %min
367− |= [a=@ b=@]
368− ^- @
369− ?: (lth a b) a
370− b
371−
372−Examples
373−--------
374−
375− > (min 10 100)
376− 10
377− > (min 10.443 9)
378− 9
379− > (min 0 1)
152+ > (div 20 30)
380153 0
381154
155+ > (div 'ab' 'a')
156+ 259
157+ > `@`'ab'
158+ 25.185
159+ > `@`a
160+ 97
382161
162+ > (div 0x9f 0x29)
163+ 6
164+ > `@`0x9f ::`0x9f` is an atom represented in the hexadecimal soft atom type (`@ux`).
165+ 159
166+ > `@`0x29
167+ 41
383168
384−***
385−### `++mod`
386−
387−Modulus
388−
389−Computes the remainder of dividing `a` by `b`.
390−
391−Accepts
392−-------
393−
394−`a` is an atom.
395−
396−`b` is an atom.
397−
398−Produces
399−--------
400−
401−An atom.
402−
403−Source
404−------
405−
406− ++ mod :: remainder
407− ~/ %mod
408− |: [a=`@`1 b=`@`1]
409− ^- @
410− ?< =(0 b)
411− (sub a (mul b (div a b)))
412−
413−
414−Examples
415−--------
416−
417− > (mod 5 2)
418− 1
419− > (mod 5 5)
169+ > (div 0x29 0x9f)
420170 0
421171
422−
423−
424−***
425−### `++mul`
426−
427−Multiply
428−
429−Multiplies `a` by `b`.
430−
431−Accepts
432−-------
433−
434−`a` is an atom.
435−
436−`b` is an atom.
437−
438−Produces
439−--------
440−
441−An atom.
442−
443−Source
444−------
445−
446− ++ mul :: multiply
447− ~/ %mul
448− |: [a=`@`1 b=`@`1]
449− ^- @
450− =+ c=0
451− |-
452− ?: =(0 a) c
453− $(a (dec a), c (add b c))
454−
455−Examples
456−--------
457−
458− > (mul 3 4)
459− 12
460− > (mul 0 1)
172+ > (div ~sibtel-tallyd ~zod)
173+ ! exit
174+ > `@`~sibtel-tallyd
175+ 7.303.014
176+ > `@`~zod ::the above operation returned an error because `~zod` is a representation of `0`.
461177 0
462178
179+ > `@p`2 ::this casts `2` to `@p` to produce the ship name which represents that atom.
180+ ~bud
181+ > (div ~sibtel-tallyd ~bud)
182+ > 3.651.507
463183
464184
465185***
466−### `++sub`
186+### `++dvr`
467187
468−Subtract
188+Divide with remainder
469189
470−Subtracts `b` from `a`.
471−
472−Accepts
473−-------
474−
475−`a` is an atom.
476−
477−`b` is an atom.
190+Computes `a` divided by `b` and the remainder of that operation.
478191
479192Produces
480−--------
481−
482−An atom.
483−
484−Source
485−------
486−
487− ++ sub :: subtract
488− ~/ %sub
489− |= [a=@ b=@]
490− ~| %subtract-underflow
491− ^- @
492− ?: =(0 b) a
493− $(a (dec a), b (dec b))
494−
495−Examples
496−--------
497−
498− > (sub 10 5)
499− 5
500− > (sub 243 44)
501− 199
502− > (sub 5 0)
503− 5
504− > (sub 0 5)
505− ! subtract-underflow
506− ! exit
507−
508−
509−
510−***
511−
512−Decrements `a` by `1`.
513−
514−Accepts
515193-------
516194
517−`a` is an atom.
518−
519−Produces
520−--------
521−
522−An atom.
195+A cell of atoms.
523196
524197Source
525198------
526199
527− ++ dec :: decrement
528− ~/ %dec
529− |= a=@
530− ~| %decrement-underflow
531− ?< =(0 a)
532− =+ b=0
533− |- ^- @
534− ?: =(a +(b)) b
535− $(b +(b))
536−
200+ ++ dvr
201+ ~/ %dvr
202+ |= [a=@ b=@]
203+ ^- [p=@ q=@]
204+ [(div a b) (mod a b)]
205+ ::
537206Examples
538207--------
208+ > (dvr 17 8)
209+ [p=2 q=1]
539210
540− > (dec 7)
541− 6
542− > (dec 0)
543− ! decrement-underflow
544− ! exit
545−
211+ > (dvr 17 6)
212+ [p=2 q=5]
546213
214+ > (dvr 18 6)
215+ [p=3 q=0]
547216
548−***
549−### `++div`
217+ > (dvr 4 2)
218+ [p=2 q=0]
550219
551−Divide
220+ > (dvr 'ab 'a')
221+ [p=259 q=62]
222+ > `@`'a' ::`a` is an atom represented as a different data type.
223+ 97 We can cast it to the aura `@` to see what its integer representation is.
224+ > `@`'ab'
225+ 25.185
552226
553−Computes `a` divided by `b`.
554−
555−Accepts
556−-------
557−
558−`a` is an atom.
559−
560−`b` is an atom.
561−
562−Produces
563−--------
564−
565−An atom.
566−
567−Source
568−------
569−
570− ++ div :: divide
571− ~/ %div
572− |= [a=@ b=@]
573− ^- @
574− ~| 'div'
575− ?< =(0 b)
576− =+ c=0
577− |-
578− ?: (lth a b) c
579− $(a (sub a b), c +(c))
580− ::
581−
582−Examples
583−--------
584−
585− > (div 4 2)
586− 2
587− > (div 17 8)
588− 2
589− > (div 20 30)
590− 0
227+ > (dvr '' 'a')
228+ [p=0 q=0]
591229
592230
593231***
@@ -595,7 +233,7 @@ Examples
595233
596234Greater-than/equal
597235
598−Tests whether `a` is greater than a number `b`.
236+Tests whether a number `a` is greater than or equal a number `b`.
599237
600238Accepts
601239-------
@@ -607,28 +245,41 @@ Accepts
607245Produces
608246--------
609247
610−A boolean.
248+A flag. Our version of a boolean, except that `0` is yes/true and `1` is no/false.
611249
612250Source
613251------
614252
615− ++ gte :: greater-equal
253+ ++ gte
616254 ~/ %gte
617255 |= [a=@ b=@]
618256 ^- ?
619257 !(lth a b)
620−
621−
258+ ::
622259Examples
623260--------
624261
625262 > (gte 100 10)
626263 %.y
264+
627265 > (gte 4 4)
628266 %.y
267+
629268 > (gte 3 4)
630269 %.n
631270
271+ > `@`'h' ::`h` is an atom represented as a `cord`, one of many different soft atom types.
272+ 104 ::We can cast it to the mold `@` to see what its integer representation is.
273+ > `@`'b'
274+ 98
275+ > (gte 'h' 'b')
276+ %.y
277+
278+ > (gte '0xc' '0xf')
279+ %.n
280+
281+ > (gte '0xc' '0xc')
282+ %.y
632283
633284
634285***
@@ -648,27 +299,41 @@ Accepts
648299Produces
649300--------
650301
651−A boolean.
302+A flag; our version of a boolean, except that `0` is yes/true and `1` is no/false.
652303
653304Source
654305------
655306
656− ++ gth :: greater-than
307+ ++ gth
657308 ~/ %gth
658309 |= [a=@ b=@]
659310 ^- ?
660311 !(lte a b)
661−
662−
663−
312+ ::
664313Examples
665314--------
315+ > (gth 2 1)
316+ %.y
317+
318+ > (gth 1 2)
319+ %.n
666320
667321 > (gth 'd' 'c')
668322 %.y
669− > (gth ~h1 ~m61)
323+ > `@`'d' ::`d` is an atom represented as a `cord`, one of many different soft atom types.
324+ 100 ::We can cast it to the mold `@` to see what its integer representation is.
325+ > `@`'c'
326+ 99
327+
328+ > (gth 'doug' 'catherine')
670329 %.n
330+ > `@`'doug'
331+ 1.735.749.476
332+ > `@`'catherine'
333+ 1.871.077.167.441.261.125.987
671334
335+ > (gth ~h1 ~m61) ::~h1 and ~m61 are both relative dates. Cast an atom to `@dr` to see its representation in that soft atom type.
336+ %.n
672337
673338
674339***
@@ -688,30 +353,43 @@ Accepts
688353Produces
689354--------
690355
691−A boolean.
356+A flag; our version of a boolean, except that `0` is yes/true and `1` is no/false.
692357
693358Source
694359------
695360
696− ++ lte :: less-equal
361+ ++ lte
697362 ~/ %lte
698363 |= [a=@ b=@]
699364 |(=(a b) (lth a b))
700−
701365 ::
702−
703366Examples
704367--------
705368
706369 > (lte 4 5)
707370 %.y
371+
708372 > (lte 5 4)
709373 %.n
374+
710375 > (lte 5 5)
711376 %.y
377+
712378 > (lte 0 0)
713379 %.y
714380
381+ > (lte 'a' 'b')
382+ %.y
383+ > `@`'a'
384+ 97
385+ > `@`'b'
386+ 98
387+
388+ > (lte 'abraham' 'bob')
389+ %.n
390+
391+ > (lte ~m61 ~h1) ::~m61 and ~h1 are both relative dates. Cast an atom to `@dr` to see its representation in that soft atom type.
392+ %.n
715393
716394
717395***
@@ -731,12 +409,12 @@ Accepts
731409Produces
732410--------
733411
734−A boolean.
412+A flag; our version of a boolean, except that `0` is yes/true and `1` is no/false.
735413
736414Source
737415------
738416
739− ++ lth :: less-than
417+ ++ lth
740418 ~/ %lth
741419 |= [a=@ b=@]
742420 ^- ?
@@ -746,19 +424,36 @@ Source
746424 ?& !=(0 b)
747425 $(a (dec a), b (dec b))
748426 == == ==
749−
427+ ::
750428Examples
751429--------
752430
753431 > (lth 4 5)
754432 %.y
433+
755434 > (lth 5 4)
756435 %.n
436+
757437 > (lth 5 5)
758438 %.n
439+
759440 > (lth 5 0)
760441 %.n
761442
443+ > (lth 'a' 'b')
444+ %.y
445+ > `@`'a' ::`a` is an atom represented as a different data type.
446+ 97 ::We can cast it to the aura `@` to see what its integer representation is.
447+ > `@`'b'
448+ 98
449+
450+ > (lth 'abraham' 'bob')
451+ %.n
452+ > `@`'abraham'
453+ > 30.787.873.400.840.801
454+ > `@`'bob'
455+ > 6.451.042
456+
762457
763458***
764459### `++max`
@@ -782,24 +477,39 @@ An atom.
782477Source
783478------
784479
785− ++ max :: maximum
480+ ++ max
786481 ~/ %max
787482 |= [a=@ b=@]
788483 ^- @
789484 ?: (gth a b) a
790485 b
791−
486+ ::
792487Examples
793488--------
794489
795490 > (max 10 100)
796491 100
492+
797493 > (max 10.443 9)
798494 10.443
799− > (max 0 1)
495+
496+ > (max 1 1)
800497 1
801498
499+ > (max 'abraham' 'bob')
500+ 30.787.873.400.840.801
501+
502+ > `@t`(max 'abraham' 'bob') ::`@t` displays the product as a `cord` (string) instead of a number.
503+ 'abraham'
802504
505+ > `@t`(max 'abraham' 'benjamin')
506+ 'benjamin'
507+
508+ > `@dr`(max ~m6 ~h1) ::~m61 and ~h1 are relative dates. Cast an atom to `@dr` to see its representation in that soft atom type.
509+ ~h1
510+
511+ >`@ux`(max 0xe1 0x1e) ::`0xe1` and `0x1e` are of the hexadecimal soft atom type (`@ux`).
512+ 0xe1
803513
804514***
805515### `++min`
@@ -823,23 +533,36 @@ An atom.
823533Source
824534------
825535
826− ++ min :: minimum
536+ ++ min
827537 ~/ %min
828538 |= [a=@ b=@]
829539 ^- @
830540 ?: (lth a b) a
831541 b
832−
542+ ::
833543Examples
834544--------
835545
836546 > (min 10 100)
837547 10
548+
838549 > (min 10.443 9)
839550 9
840− > (min 0 1)
841− 0
842551
552+ > (min 1 1)
553+ 1
554+
555+ > (min 'abraham' 'bob')
556+ 6.451.042
557+
558+ > `@t`(min 'abraham' 'bob') ::`@t` causes the product to display as a `cord` instead of a number.
559+ 'bob'
560+
561+ > `@t`(min 'abraham' 'benjamin')
562+ 'abraham'
563+
564+ > `@dr`(min ~m6 ~h1) ::~m61 and ~h1 are relative dates. Cast an atom to `@dr` to see its representation in that soft atom type.
565+ ~m6
843566
844567
845568***
@@ -864,22 +587,39 @@ An atom.
864587Source
865588------
866589
867− ++ mod :: remainder
590+ ++ mod
868591 ~/ %mod
869592 |: [a=`@`1 b=`@`1]
870593 ^- @
871594 ?< =(0 b)
872595 (sub a (mul b (div a b)))
873−
874−
596+ ::
875597Examples
876598--------
877599
878600 > (mod 5 2)
879601 1
602+
880603 > (mod 5 5)
881604 0
882605
606+ > (mod 2 5)
607+ 2
608+
609+ > (mod 40 20)
610+ 0
611+
612+ > `@`'c' ::`a` is an atom represented as a different data type.
613+ 99 ::We can cast it to the aura `@` to see what its integer representation is.
614+ >`@`'a'
615+ 97
616+ > (mod 'c' 'a')
617+ 2
618+
619+ > (mod 0xe1 0x1e) ::`0xe1` and `0x1e` are of the hexadecimal soft atom type (`@ux`).
620+ 15
621+ > `@ux`(mod 0xe1 0x1e)
622+ 0xf
883623
884624
885625***
@@ -904,7 +644,7 @@ An atom.
904644Source
905645------
906646
907− ++ mul :: multiply
647+ ++ mul
908648 ~/ %mul
909649 |: [a=`@`1 b=`@`1]
910650 ^- @
@@ -912,15 +652,27 @@ Source
912652 |-
913653 ?: =(0 a) c
914654 $(a (dec a), c (add b c))
915−
655+ ::
916656Examples
917657--------
918658
919659 > (mul 3 4)
920− 12
921− > (mul 0 1)
660+ 12
661+
662+ > (mul 0 1)
922663 0
923664
665+ > `@`'a' ::`a` is an atom represented as a different data type.
666+ 97 ::We can cast it to the aura `@` to see what its integer representation is.
667+ > `@`'b'
668+ 98
669+ > (mul 'a' 'b')
670+ 9.506
671+
672+ > (mul 0x1f 0xe) ::`0x1f` and `0xe` are of the hexadecimal soft atom type (`@ux`).
673+ 424
674+ >`@ux`(mul 0x1f 0xe)
675+ 0x1b2
924676
925677
926678***
@@ -945,27 +697,41 @@ An atom.
945697Source
946698------
947699
948− ++ sub :: subtract
949− ~/ %sub
950− |= [a=@ b=@]
951− ~| %subtract-underflow
952− ^- @
953− ?: =(0 b) a
954− $(a (dec a), b (dec b))
955−
700+ ++ sub
701+ ~/ %sub
702+ |= [a=@ b=@]
703+ ~| %subtract-underflow
704+ ^- @
705+ ?: =(0 b) a
706+ $(a (dec a), b (dec b))
707+ ::
956708Examples
957709--------
958710
959711 > (sub 10 5)
960712 5
713+
961714 > (sub 243 44)
962715 199
716+
963717 > (sub 5 0)
964718 5
719+
965720 > (sub 0 5)
966721 ! subtract-underflow
967722 ! exit
968723
724+ > (sub 'c' 'a')
725+ 2
726+ > `@`'c' ::`a` is an atom represented as a different data type.
727+ 99 ::We can cast it to the aura `@` to see what its integer representation is.
728+ > `@`'a'
729+ 97
730+
731+ > (sub 0x1f 0xe)
732+ 17
733+ > `@ux`(sub 0x1f 0xe) ::`0xe1` and `0x1e` are of the hexadecimal soft atom type (`@ux`).
734+ 0x11
969735
970736
971737***