@@ -1,5889 +0,0 @@
1−+++
2−title = "3b: Floating Point"
3−weight = 22
4−template = "doc.html"
5−aliases = ["/docs/reference/library/3b"]
6−+++
7−### `++fn`
8−
9−Float
10−
11−A mold for the floating-point arithmetic using the base of two, the formula is
12−`(-1)^s * a * 2^e`.
13−
14−Produces either a float (`$f`), an infinity of other sign (`$i`),
15−or not-a-number (`$n`). `s` refers to sign, the `flag`s `&` or `|`; `e` to
16−exponent, a signed decimal; and `a` to the significand, an unsigned integer.
17−
18−#### Source
19−
20−```hoon
21− ++ fn
22− $% [$f s=? e=@s a=@u]
23− [$i s=?]
24− [$n ~]
25− ==
26−```
27−
28−### Examples
29−
30−```
31− > *fn
32− [%n ~]
33−
34− > (add:fl [%f & --33 2] [%f | --23 2])
35− [%f s=%.y e=-79 a=10.374.452.512.267.829.421.849.019.032.797.184]
36−
37− > (add:fl [%i &] [%i &])
38− [%i s=%.y]
39−
40− > (add:fl [%n ~] [%i |])
41− [%n ~]
42−
43− > (sun:fl 961.193.554.848.514.048.973.893.027.381.506.219.443)
44− [%f s=%.y e=--17 a=7.333.324.850.834.000.007.430.214.137.126.970]
45−```
46−
47−
48−---
49−### `++dn`
50−
51−Decimal float
52−
53−A mold for the floating-point arithmetic using the base of 10; the formula is
54−`(-1)^s * a *10^e`.
55−
56−Valid values are a float (`$d`), an infinity (`$i`), or a not-a-number (`$n`).
57−`s` refers to sign, the `flag`s `&` or `|`; `e` to exponent, a signed decimal;
58−and `a` to the significand, an unsigned integer.
59−
60−```hoon
61− ++ dn
62− $% [$d s=? e=@s a=@u]
63− [$i s=?]
64− [$n ~]
65− ==
66−```
67−
68−#### Examples
69−
70−```
71− > `dn`[%d & --0 17.163.091.968]
72− [%d s=%.y e=--0 a=17.163.091.968]
73−
74− > `dn`[%i s=%.y]
75− [%i s=%.y]
76−
77− > `dn`[%n ~]
78− [%n ~]
79−```
80−
81−---
82−### `++rn`
83−
84−Parsed decimal float
85−
86−A mold for the floating-point arithmetic using the base of 10; the formula is
87−`(-1)^s * a *10^e`.
88−
89−Produces either a parsed float (`$d`), infinity of either sign (`$i`), or
90−not-a-number (`$n`).
91−
92−#### Source
93−
94−```hoon
95− $% [$d a=? b=[c=@ [d=@ e=@] f=? i=@]]
96− [$i a=?]
97− [$n ~]
98− ==
99−```
100−
101−#### Examples
102−
103−```
104− > `rn`[%d | [2 [3 4] | 17.163]]
105− [%d a=%.n b=[c=2 [d=3 e=4] f=%.n i=17.163]]
106−```
107−
108−---
109−### `++fl`
110−
111−Arbitrary-precision floating-point
112−
113−Container arm for floating-point arithmetic functions.
114−
115−- Precision (`p`): number of bits in the significand; must be at least 2.
116− Default is 113.
117−- Minimum exponent (`v`): minimum value of e. Default is -16.494.
118−- Width (`w`): Max value of `e` minus min value of `e`. 0 is for fixed-point.
119− Default is 32.765.
120−- Rounding mode (`r`): Possible modes are nearest (`$n`), up (`$u`),
121− down (`$d`), to zero (`$z`), and away from zero (`$a`). Default value is `%n`.
122−- Behavior (`d`): return denormals (`$d`), flush denormals to zero (`$z`),
123− infinite exponent range (`$i`). Default value is `%d`.
124−
125−#### Source
126−
127−```hoon
128− ++ fl
129− =+ ^- [[p=@u v=@s w=@u] r=$?($n $u $d $z $a) d=$?($d $f $i)]
130− [[113 -16.494 32.765] %n %d]
131− =>
132− ~% %cofl +> ~
133− |%
134−```
135−
136−---
137−### `++rou:fl`
138−
139−Round
140−
141−Rounds `a` to a the nearest float that can be represented with a 113-bit
142−significand. There is no term to sign the significand, meaning that a positive
143−sign will always be produced.
144−
145−#### Accepts
146−
147−`a` is a cell of a signed integer and an unsigned integer.
148−
149−#### Produces
150−
151−An `fn`.
152−
153−#### Source
154−
155−```hoon
156− ++ rou
157− |= [a=[e=@s a=@u]] ^- fn (rau a &)
158−```
159−
160−#### Examples
161−
162−```
163− > =a 10.161.487.211.429.486.882.397.572.894.294.017.777
164− > (^rou:fl [--12 a])
165− [%f s=%.y e=--22 a=9.923.327.354.911.608.283.591.379.779.584.002]
166−
167− > (^rou:fl [--12 (add a 1)])
168− [%f s=%.y e=--22 a=9.923.327.354.911.608.283.591.379.779.584.002]
169−
170− > (^rou:fl [--12 (add a 300)])
171− [%f s=%.y e=--22 a=9.923.327.354.911.608.283.591.379.779.584.002]
172−
173− > (^rou:fl [--12 (add a 1.000)])
174− [%f s=%.y e=--22 a=9.923.327.354.911.608.283.591.379.779.584.003]
175−```
176−
177−---
178−### `++rau:fl`
179−
180−Various roundings
181−
182−Rounds `a` based on what the state of of `r` in the core contained in `fl`. `t`
183−is a sticky bit that represents a value less than ULP(a) = 2^(e.a) when passed
184−to `lug:fl`.
185−
186−#### Accepts
187−
188−`a` is a cell of a signed integer and an unsigned integer.
189−
190−`t` is a `flag`.
191−
192−#### Produces
193−
194−An `fn`.
195−
196−#### Source
197−
198−```hoon
199− ++ rau
200− |= [a=[e=@s a=@u] t=?] ^- fn
201− ?- r
202− $z (lug %fl a t) $d (lug %fl a t)
203− $a (lug %ce a t) $u (lug %ce a t)
204− $n (lug %ne a t)
205− ==
206−```
207−
208−#### Examples
209−
210−```
211− > (rau:fl [-18 342.602.577] &)
212− [%f s=%.y e=-102 a=6.626.897.619.228.945.634.459.505.846.648.832]
213−```
214−
215−
216−#### Discussion
217−
218−See `lug:fl` for possible rounding operations.
219−
220−---
221−### `++add:fl`
222−
223−Add
224−
225−Produces the sum of `a` and `b`. `e` is used to choose between an exact result
226−(any-sized significand) or a rounded result (113-bit significand).
227−
228−There is no term to sign the significands, so a positive sign will always be
229−produced.
230−
231−#### Accepts
232−
233−`a` is an `fn`.
234−
235−`b` is an `fn`
236−
237−`e` is a `flag`.
238−
239−#### Produces
240−
241−An `fn`.
242−
243−#### Source
244−
245−```hoon
246− ++ add
247− |= [a=[e=@s a=@u] b=[e=@s a=@u] e=?] ^- fn
248− =+ q=(dif:si e.a e.b)
249− |- ?. (syn:si q) $(b a, a b, q +(q)) :: a has larger exp
250− ?: e
251− [%f & e.b (^add (lsh 0 (abs:si q) a.a) a.b)]
252− =+ [ma=(met 0 a.a) mb=(met 0 a.b)]
253− =+ ^= w %+ dif:si e.a %- sun:si :: expanded exp of a
254− ?: (gth prc ma) (^sub prc ma) 0
255− =+ ^= x %+ sum:si e.b (sun:si mb) :: highest exp for b
256− ?: =((cmp:si w x) --1) :: don't need to add
257− ?- r
258− $z (lug %fl a &) $d (lug %fl a &)
259− $a (lug %lg a &) $u (lug %lg a &)
260− $n (lug %na a &)
261− ==
262− (rou [e.b (^add (lsh 0 (abs:si q) a.a) a.b)])
263−```
264−
265−#### Examples
266−
267−```
268− > (^add:fl [--33 2.718] [--23 11] %.y)
269− [%f s=%.y e=--23 a=2.783.243]
270−
271− > (^add:fl [--33 2.718] [--23 11] %.n)
272− [%f s=%.y e=-68 a=6.890.975.897.521.519.304.902.126.405.156.864]
273−```
274−
275−---
276−### `++sub:fl`
277−
278−Subtract
279−
280−Produces the difference of `a` minus `b.` `e` is used to choose between an exact
281−result (any-sized significand) or a rounded result (113-bit significand).
282−
283−#### Accepts
284−
285−`a` is a cell of a signed integer and an unsigned integer.
286−
287−`b` is a cell of a signed integer and an unsigned integer.
288−
289−`e` is a `flag`.
290−
291−#### Produces
292−
293−An `fn`.
294−
295−#### Source
296−
297−```hoon
298− ++ sub
299− |= [a=[e=@s a=@u] b=[e=@s a=@u] e=?] ^- fn
300− =+ q=(dif:si e.a e.b)
301− |- ?. (syn:si q)
302− (fli $(b a, a b, q +(q), r swr))
303− =+ [ma=(met 0 a.a) mb=(met 0 a.b)]
304− =+ ^= w %+ dif:si e.a %- sun:si
305− ?: (gth prc ma) (^sub prc ma) 0
306− =+ ^= x %+ sum:si e.b (sun:si +(mb))
307− ?: &(!e =((cmp:si w x) --1))
308− ?- r
309− $z (lug %sm a &) $d (lug %sm a &)
310− $a (lug %ce a &) $u (lug %ce a &)
311− $n (lug %nt a &)
312− ==
313− =+ j=(lsh 0 (abs:si q) a.a)
314− |- ?. (gte j a.b)
315− (fli $(a.b j, j a.b, r swr))
316− =+ i=(^sub j a.b)
317− ?~ i [%f & zer]
318− ?: e [%f & e.b i] (rou [e.b i])
319−```
320−
321−#### Examples
322−
323−```
324− > (^sub:fl [--33 2.718] [--23 11] %.y)
325− [%f s=%.y e=--23 a=2.783.221]
326−
327− > (^sub:fl [--33 2.718] [--63 11] %.y)
328− [%f s=%.n e=--33 a=11.811.157.346]
329−```
330−
331−---
332−### `++mul:fl`
333−
334−Multiply
335−
336−Produces the product of `a` multiplied by `b`. There is no term to sign the
337−significands, so a positive sign will always be produced.
338−
339−#### Accepts
340−
341−`a` is a cell of a signed integer and an unsigned integer.
342−
343−`b` is a cell of a signed integer and an unsigned integer.
344−
345−#### Produces
346−
347−An `fn`.
348−
349−#### Source
350−
351−```hoon
352− ++ mul
353− |= [a=[e=@s a=@u] b=[e=@s a=@u]] ^- fn
354− (rou (sum:si e.a e.b) (^mul a.a a.b))
355−```
356−
357−#### Examples
358−
359−```
360− > (^mul:fl [--3 2.718] [--23 11])
361− [%f s=%.y e=-72 a=9.475.054.411.405.900.661.487.108.108.582.912]
362−```
363−
364−---
365−### `++div:fl`
366−
367−Divide
368−
369−Produces the quotient of `a` divided by `b`. There is no term to sign the
370−significands, so a positive sign will always be produced.
371−
372−#### Accepts
373−
374−`a` is a cell of a signed integer and an unsigned integer.
375−
376−`b` is a cell of a signed integer and an unsigned integer.
377−
378−#### Produces
379−
380−An `fn`.
381−
382−#### Source
383−
384−```hoon
385− ++ div
386− |= [a=[e=@s a=@u] b=[e=@s a=@u]] ^- fn
387− =+ [ma=(met 0 a.a) mb=(met 0 a.b)]
388− =+ v=(dif:si (sun:si ma) (sun:si +((^add mb prc))))
389− =. a ?: (syn:si v) a
390− a(e (sum:si v e.a), a (lsh 0 (abs:si v) a.a))
391− =+ [j=(dif:si e.a e.b) q=(dvr a.a a.b)]
392− (rau [j p.q] =(q.q 0))
393−```
394−
395−#### Examples
396−
397−```
398− > (^div:fl [--13 2.718] [--23 11])
399− [%f s=%.y e=-115 a=10.023.198.055.040.952.765.870.659.817.343.907]
400−```
401−
402−---
403−### `++sqt:fl`
404−
405−Square root
406−
407−Produces the square root of `a`.
408−
409−#### Accepts
410−
411−`a` is a cell of a signed integer and an unsigned integer.
412−
413−#### Produces
414−
415−An `fn`.
416−
417−#### Source
418−
419−```hoon
420− ++ sqt
421− |= [a=[e=@s a=@u]] ^- fn
422− =. a
423− =+ [w=(met 0 a.a) x=(^mul +(prc) 2)]
424− =+ ?:((^lth w x) (^sub x w) 0)
425− =+ ?: =((dis - 1) (dis (abs:si e.a) 1)) -
426− (^add - 1)
427− a(e (dif:si e.a (sun:si -)), a (lsh 0 - a.a))
428− =+ [y=(^sqt a.a) z=(fra:si e.a --2)]
429− (rau [z p.y] =(q.y 0))
430−```
431−
432−#### Examples
433−
434−```
435− > (^sqt:fl [-18 342.602.577])
436− [%f s=%.y e=-107 a=5.865.903.143.604.945.574.132.671.852.050.553]
437−```
438−
439−---
440−### `++lth:fl`
441−
442−Less than
443−
444−Tests if `a` is less than `b`.
445−
446−#### Accepts
447−
448−`a` is a cell of a signed integer and an unsigned integer.
449−
450−`b` is a cell of a signed integer and an unsigned integer.
451−
452−#### Produces
453−
454−An `flag`.
455−
456−#### Source
457−
458−```hoon
459− ++ lth
460− |= [a=[e=@s a=@u] b=[e=@s a=@u]] ^- ?
461− ?: =(e.a e.b) (^lth a.a a.b)
462− =+ c=(cmp:si (ibl a) (ibl b))
463− ?: =(c -1) & ?: =(c --1) |
464− ?: =((cmp:si e.a e.b) -1)
465− (^lth (rsh 0 (abs:si (dif:si e.a e.b)) a.a) a.b)
466− (^lth (lsh 0 (abs:si (dif:si e.a e.b)) a.a) a.b)
467−```
468−
469−#### Examples
470−
471−```
472− > (^lth:fl [-4 684] [--0 35])
473− %.n
474−
475− > (^lth:fl [-4 684] [--0 90])
476− %.y
477−```
478−
479−---
480−### `++equ:fl`
481−
482−Equals
483−
484−Tests if `a` is equal to `b`.
485−
486−#### Accepts
487−
488−`a` is a cell of a signed integer and an unsigned integer.
489−
490−`b` is a cell of a signed integer and an unsigned integer.
491−
492−#### Produces
493−
494−A `flag`.
495−
496−#### Source
497−
498−```hoon
499− ++ equ
500− |= [a=[e=@s a=@u] b=[e=@s a=@u]] ^- ?
501− ?. =((ibl a) (ibl b)) |
502− ?: =((cmp:si e.a e.b) -1)
503− =((lsh 0 (abs:si (dif:si e.a e.b)) a.b) a.a)
504− =((lsh 0 (abs:si (dif:si e.a e.b)) a.a) a.b)
505−```
506−
507−#### Examples
508−
509−```
510− > (^equ:fl [-4 480] [-0 50])
511− %.n
512−
513− > (^equ:fl [-4 480] [-0 30])
514− %.y
515−```
516−
517−---
518−### `++ibl:fl`
519−
520−Integer binary logarithm
521−
522−Produces the lowest power to which the number 2 must be raised to obtain `a` or
523−greater.
524−
525−#### Accepts
526−
527−`a` is a cell of a signed integer and an unsigned integer.
528−
529−#### Produces
530−
531−A signed integer.
532−
533−#### Source
534−
535−```hoon
536− ++ ibl
537− |= [a=[e=@s a=@u]] ^- @s
538− (sum:si (sun:si (dec (met 0 a.a))) e.a)
539−```
540−
541−#### Examples
542−
543−```
544− > (ibl:fl [-18 342.602.577])
545− --10
546−```
547−
548−---
549−### `++uni:fl`
550−
551−Change representation to odd
552−
553−Produces another representation of the floating point `a` where the significand
554−is odd. Every floating-point number has a unique representation of this kind. If
555−the significand of `a` is already odd, nothing changes.
556−
557−#### Accepts
558−
559−`a` is a cell of a signed integer and an unsigned integer.
560−
561−#### Produces
562−
563−A cell of a signed integer and an unsigned integer.
564−
565−#### Source
566−
567−```hoon
568− ++ uni
569− |= [a=[e=@s a=@u]]
570− |- ?: =((end 0 1 a.a) 1) a
571− $(a.a (rsh 0 1 a.a), e.a (sum:si e.a --1))
572−```
573−
574−#### Examples
575−
576−```
577− > (uni:fl [-8 342.602.578])
578− [e=-7 a=171.301.289]
579−
580− > (uni:fl [-8 342.602.577])
581− [e=-8 a=342.602.577]
582−```
583−
584−---
585−### `++xpd:fl`
586−
587−Expand
588−
589−Produces the fully precise form of `a`, or the denormalized form of `a`.
590−
591−#### Accepts
592−
593−`a` is a cell of a signed integer and an unsigned integer.
594−
595−#### Produces
596−
597−A cell of a signed integer and an unsigned integer.
598−
599−#### Sources
600−
601−```hoon
602− ++ xpd
603− |= [a=[e=@s a=@u]]
604− =+ ma=(met 0 a.a)
605− ?: (gte ma prc) a
606− =+ ?: =(den %i) (^sub prc ma)
607− =+ ^= q
608− =+ w=(dif:si e.a emn)
609− ?: (syn:si w) (abs:si w) 0
610− (min q (^sub prc ma))
611− a(e (dif:si e.a (sun:si -)), a (lsh 0 - a.a))
612−```
613−
614−#### Examples
615−
616−```
617− > (xpd:fl [--3 12])
618− [e=-106 a=7.788.445.287.802.241.442.795.744.493.830.144]
619−
620− > (xpd:fl [-8 342.602.577])
621− [e=-92 a=6.626.897.619.228.945.634.459.505.846.648.832]
622−
623− > (xpd:fl [-92 6.626.897.619.228.945.634.459.505.846.648.832])
624− [e=-92 a=6.626.897.619.228.945.634.459.505.846.648.832]
625−```
626−
627−---
628−### `++lug:fl`
629−
630−Central rounding mechanism
631−
632−Performs various rounding operations on `a`. An operation is chosen based on the
633−value selected for `t`. `s` is a sticky bit that represents a value less than
634−ULP(a) = 2^(e.a)
635−
636−Possible rounding operations:
637−- Floor (`$fl`)
638−- Ceiling (`$ce`)
639−- Smaller (`$sm`)
640−- Larger (`$lg`)
641−- Nearest (`$ne`) -- Rounds ties away from 0 if the number is even, rounds
642− toward 0 if the number is odd.
643−
644−#### Accepts
645−
646−`t` is one of the following: `$fl`, `$ce`, `$sm`, `$lg`, `$ne`, `$na`, or `$nt`.
647−
648−`a` is a cell of a signed integer and an unsigned integer.
649−
650−`s` is a flag.
651−
652−#### Produces
653−
654−An `fn`.
655−
656−#### Source
657−
658−```hoon
659− ::
660− :: central rounding mechanism
661− :: can perform: floor, ceiling, smaller, larger,
662− :: nearest (round ties to: even, away from 0, toward 0)
663− :: s is sticky bit: represents a value less than ulp(a) = 2^(e.a)
664− ::
665− ++ lug
666− ~/ %lug
667− |= [t=$?($fl $ce $sm $lg $ne $na $nt) a=[e=@s a=@u] s=?] ^- fn
668− ?< =(a.a 0)
669− =-
670− ?. =(den %f) - :: flush denormals
671− ?. ?=([$f *] -) -
672− ?: =((met 0 ->+>) prc) - [%f & zer]
673− ::
674− =+ m=(met 0 a.a)
675− ?> |(s (gth m prc)) :: require precision
676− =+ ^= q %+ max
677− ?: (gth m prc) (^sub m prc) 0 :: reduce precision
678− %- abs:si ?: =(den %i) --0 :: enforce min. exp
679− ?: =((cmp:si e.a emn) -1) (dif:si emn e.a) --0
680− =^ b a :- (end 0 q a.a)
681− a(e (sum:si e.a (sun:si q)), a (rsh 0 q a.a))
682− ::
683− ?~ a.a
684− ?< =(den %i)
685− ?- t
686− $fl [%f & zer]
687− $sm [%f & zer]
688− $ce [%f & spd]
689− $lg [%f & spd]
690− $ne ?: s [%f & ?:((lte b (bex (dec q))) zer spd)]
691− [%f & ?:((^lth b (bex (dec q))) zer spd)]
692− $nt ?: s [%f & ?:((lte b (bex (dec q))) zer spd)]
693− [%f & ?:((^lth b (bex (dec q))) zer spd)]
694− $na [%f & ?:((^lth b (bex (dec q))) zer spd)]
695− ==
696− ::
697− =. a (xpd a)
698− ::
699− =. a
700− ?- t
701− $fl a
702− $lg a(a +(a.a))
703− $sm ?. &(=(b 0) s) a
704− ?: &(=(e.a emn) !=(den %i)) a(a (dec a.a))
705− =+ y=(dec (^mul a.a 2))
706− ?. (lte (met 0 y) prc) a(a (dec a.a))
707− [(dif:si e.a --1) y]
708− $ce ?: &(=(b 0) s) a a(a +(a.a))
709− $ne ?~ b a
710− =+ y=(bex (dec q))
711− ?: &(=(b y) s) :: round halfs to even
712− ?~ (dis a.a 1) a a(a +(a.a))
713− ?: (^lth b y) a a(a +(a.a))
714− $na ?~ b a
715− =+ y=(bex (dec q))
716− ?: (^lth b y) a a(a +(a.a))
717− $nt ?~ b a
718− =+ y=(bex (dec q))
719− ?: =(b y) ?: s a a(a +(a.a))
720− ?: (^lth b y) a a(a +(a.a))
721− ==
722− ::
723− =. a ?. =((met 0 a.a) +(prc)) a
724− a(a (rsh 0 1 a.a), e (sum:si e.a --1))
725− ?~ a.a [%f & zer]
726− ::
727− ?: =(den %i) [%f & a]
728− ?: =((cmp:si emx e.a) -1) [%i &] [%f & a] :: enforce max. exp
729− ::
730−```
731−
732−---
733−### `++drg:fl`
734−
735−Get printable decimal
736−
737−Produces the decimal form of `a` using the Dragon4 algorithm. Guarantees
738−accurate results for rounded floats.
739−
740−#### Accepts
741−
742−`a` is a cell of a signed integer and an unsigned integer.
743−
744−#### Produces
745−
746−A cell of a signed integer and an unsigned integer.
747−
748−#### Source
749−
750−```hoon
751− ++ drg
752− ~/ %drg
753− |= [a=[e=@s a=@u]] ^- [@s @u]
754− ?< =(a.a 0)
755− =. a (xpd a)
756− =+ r=(lsh 0 ?:((syn:si e.a) (abs:si e.a) 0) a.a)
757− =+ s=(lsh 0 ?.((syn:si e.a) (abs:si e.a) 0) 1)
758− =+ mn=(lsh 0 ?:((syn:si e.a) (abs:si e.a) 0) 1)
759− =+ mp=mn
760− => ?.
761− ?& =(a.a (bex (dec prc))) :: if next smallest
762− |(!=(e.a emn) =(den %i)) :: float is half ULP,
763− == :: tighten lower bound
764− .
765− %= .
766− mp (lsh 0 1 mp)
767− r (lsh 0 1 r)
768− s (lsh 0 1 s)
769− ==
770− =+ [k=--0 q=(^div (^add s 9) 10)]
771− |- ?: (^lth r q)
772− %= $
773− k (dif:si k --1)
774− r (^mul r 10)
775− mn (^mul mn 10)
776− mp (^mul mp 10)
777− ==
778− |- ?: (gte (^add (^mul r 2) mp) (^mul s 2))
779− $(s (^mul s 10), k (sum:si k --1))
780− =+ [u=0 o=0]
781− |- :: r/s+o = a*10^-k
782− =+ v=(dvr (^mul r 10) s)
783− => %= .
784− k (dif:si k --1)
785− u p.v
786− r q.v
787− mn (^mul mn 10)
788− mp (^mul mp 10)
789− ==
790− =+ l=(^lth (^mul r 2) mn) :: in lower bound
791− =+ ^= h :: in upper bound
792− ?| (^lth (^mul s 2) mp)
793− (gth (^mul r 2) (^sub (^mul s 2) mp))
794− ==
795− ?: &(!l !h)
796− $(o (^add (^mul o 10) u))
797− =+ q=&(h |(!l (gth (^mul r 2) s)))
798− =. o (^add (^mul o 10) ?:(q +(u) u))
799− [k o]
800−```
801−
802−#### Examples
803−
804−```
805− > (sun:fl 218.116)
806− [%f s=%.y e=-95 a=8.640.464.947.480.640.129.276.716.135.743.488]
807− > (^drg:fl [e=-95 a=8.640.464.947.480.640.129.276.716.135.743.488])
808− [--0 218.116]
809−
810− > (sun:fl 102.057.673.128.349)
811− [%f s=%.y e=-66 a=7.530.527.107.827.833.883.675.587.233.447.936]
812− > (^drg:fl [e=-66 a=7.530.527.107.827.833.883.675.587.233.447.936])
813− [--0 102.057.673.128.349]
814−```
815−
816−---
817−### `++toj:fl`
818−
819−Round to integer
820−
821−Rounds float `a` to the nearest decimal float with an exponent of 0.
822−
823−#### Accepts
824−
825−`a` is a cell of a signed integer and an unsigned integer.
826−
827−#### Produces
828−
829−An `fn`.
830−
831−#### Source
832−
833−```hoon
834− ++ toj
835− |= [a=[e=@s a=@u]] ^- fn
836− ?. =((cmp:si e.a --0) -1) [%f & a]
837− =+ x=(abs:si e.a)
838− =+ y=(rsh 0 x a.a)
839− ?: |(=(r %d) =(r %z)) [%f & --0 y]
840− =+ z=(end 0 x a.a)
841− ?: |(=(r %u) =(r %a)) [%f & --0 ?~(z y +(y))]
842− =+ i=(bex (dec x))
843− ?: &(=(z i) =((dis y 1) 0)) [%f & --0 y]
844− ?: (^lth z i) [%f & --0 y] [%f & --0 +(y)]
845−```
846−
847−#### Examples
848−
849−```
850− > (^toj:fl [-11 7.530.107.827.833.587])
851− [%f s=%.y e=--0 a=3.676.810.462.809]
852−
853− > (^toj:fl [-11 7.530.107.827.833.589])
854− [%f s=%.y e=--0 a=3.676.810.462.809]
855−```
856−
857−---
858−### `++ned:fl`
859−
860−Require float
861−
862−Produces `a` if `a` is a is of floating-point representation. If `a` is another
863−case of `fn`, such as infinity or not-a-number, a crash is produced.
864−
865−#### Accepts
866−
867−`a` is an `fn`.
868−
869−#### Produces
870−
871−A cell of a signed integer and an unsigned integer.
872−
873−#### Source
874−
875−```hoon
876− ++ ned
877− |= [a=fn] ^- [$f s=? e=@s a=@u]
878− ?: ?=([$f *] a) a
879− ~_ leaf+"need-float"
880− !!
881−```
882−
883−#### Examples
884−
885−
886−```
887− > (ned:fl [%f s=%.y e=-11 a=7.530.107.827.833.587])
888− [%f s=%.y e=-11 a=7.530.107.827.833.587]
889−
890− > (ned:fl [%n ~])
891− ! need-float
892− ! exit
893−
894− > (ned:fl [%i |])
895− ! need-float
896− ! exit
897−```
898−
899−---
900−### `++shf:fl`
901−
902−Shift power
903−
904−Multiplies `a` by 2 to the `b` power without rounding. This results in shifting
905−the exponent term by `b`.
906−
907−#### Accepts
908−
909−`a` is an `fn`.
910−
911−`b` is a signed integer.
912−
913−#### Produces
914−
915−An `fn`.
916−
917−#### Source
918−
919−```hoon
920− ++ shf
921− |= [a=fn b=@s]
922− ?: |(?=([$n *] a) ?=([$i *] a)) a
923− a(e (sum:si e.a b))
924−```
925−
926−#### Examples
927−
928−```
929− > (shf:fl [[%f & -2 7] --2])
930− [%f s=%.y e=--0 a=7]
931−
932− > (shf:fl [[%f & -2 7] -2])
933− [%f s=%.y e=-4 a=7]
934−
935− > (shf:fl [%f & -11 7.530.107.827.833.587] --5)
936− [%f s=%.y e=-6 a=7.530.107.827.833.587]
937−```
938−
939−---
940−### `++fli:fl`
941−
942−Flip sign
943−
944−Produces `a` with its signed changed from positive to negative, or vice versa.
945−
946−#### Accepts
947−
948−`a` is an `fn`.
949−
950−#### Produces
951−
952−An `fn`.
953−
954−#### Source
955−
956−```hoon
957− ++ fli
958− |= [a=fn] ^- fn
959− ?-(-.a $f a(s !s.a), $i a(s !s.a), $n a)
960−```
961−
962−#### Examples
963−
964−```
965− > (fli:fl [%f %.y -2 7])
966− [%f s=%.n e=-2 a=7]
967−
968− > (fli:fl [%f %.n --2 30.617])
969− [%f s=%.y e=--2 a=30.617]
970−
971− > (fli:fl [%f | --2 30.617])
972− [%f s=%.y e=--2 a=30.617]
973−```
974−
975−---
976−### `++swr:fl`
977−
978−Switch rounding
979−
980−Switches the rounding mode of `r:fl`.
981−
982−#### Source
983−
984−```hoon
985− ++ swr ?+(r r $d %u, $u %d)
986−```
987−
988−#### Examples
989−
990−```
991− > r:fl
992− %n
993− > swr:fl
994− %n
995−
996− > =new-fl fl :: new fl core with changed state
997− > =new-fl new-fl(r %u)
998− > swr:new-fl
999− %d
1000−```
1001−
1002−---
1003−### `++prc:fl`
1004−
1005−Force precision of 2 or greater
1006−
1007−Produces `p`, the core's precision, if `p` is greater than or equal to 2.
1008−Otherwise, a crash is produced.
1009−
1010−#### Source
1011−
1012−```hoon
1013− ++ prc ?>((gth p 1) p)
1014−```
1015−
1016−#### Examples
1017−
1018−```
1019− > prc:fl
1020− 113
1021−
1022− > =new-fl fl
1023− > =new-fl new-fl(p 1)
1024− > prc:new-fl
1025− ! exit
1026−
1027− > =new-fl new-fl(p 2)
1028− > prc:new-fl
1029− 2
1030−```
1031−
1032−---
1033−### `++den:fl`
1034−
1035−Behavior
1036−
1037−Produces `d:fl`. Denormalizes if `d:fl` is `%d`. Flushes denormals to zero if
1038−`d:fl` is `%f`.
1039−
1040−- Denormalizes if `d:fl` is `%d`.
1041−- Flushes denormals to zero if `d:fl` is `%f`.
1042−- Infinite exponent range if `$d` is `$i`.
1043−
1044−The default value of `d` is `%d`.
1045−
1046−#### Source
1047−
1048−```hoon
1049− ++ den d
1050−```
1051−
1052−#### Examples
1053−
1054−```
1055− > den:fl
1056− %d
1057−
1058− > =new-fl fl
1059− > =new-fl new-fl(d %f)
1060− > den:new-fl
1061− %f
1062−```
1063−
1064−---
1065−### `++emn:fl`
1066−
1067−Minimum exponent
1068−
1069−Produces `v:fl`, the minimum exponent. The default minimum exponent is -16.494.
1070−
1071−#### Source
1072−
1073−```hoon
1074− ++ emn v
1075−```
1076−
1077−#### Examples
1078−
1079−```
1080− > emn:fl
1081− -16.494
1082−```
1083−
1084−---
1085−### `++emx:fl`
1086−
1087−Maximum exponent
1088−
1089−Returns the maximum exponent of `fl`. The default maximum exponent is --16.271.
1090−
1091−#### Source
1092−
1093−```hoon
1094− ++ emx (sum:si emn (sun:si w))
1095−```
1096−
1097−#### Examples
1098−
1099−```
1100− > emx:fl
1101− --16.271
1102−
1103− > `@u`emx:fl
1104− 32.542
1105−```
1106−
1107−---
1108−### `++spd:fl`
1109−
1110−Smallest denormal
1111−
1112−Produces the smallest possible denormalized float.
1113−
1114−#### Source
1115−
1116−```hoon
1117− ++ spd [e=emn a=1]
1118−```
1119−
1120−#### Examples
1121−
1122−```
1123− > spd:fl
1124− [e=-16.494 a=1]
1125−```
1126−
1127−---
1128−### `++spn:fl`
1129−
1130−Smallest normal
1131−
1132−Produces the smallest representable normal float.
1133−
1134−#### Source
1135−
1136−```hoon
1137− ++ spn [e=emn a=(bex (dec prc))]
1138−```
1139−
1140−#### Examples
1141−
1142−```
1143− > spn:fl
1144− [e=-16.494 a=5.192.296.858.534.827.628.530.496.329.220.096]
1145−```
1146−
1147−---
1148−### `++lfn:fl`
1149−
1150−Largest normal
1151−
1152−Produces the largest representable normal float.
1153−
1154−#### Source
1155−
1156−```hoon
1157− ++ lfn [e=emx a=(fil 0 prc 1)]
1158−```
1159−
1160−#### Examples
1161−
1162−```
1163− > lfn:fl
1164− [e=--16.271 a=10.384.593.717.069.655.257.060.992.658.440.191]
1165−```
1166−
1167−---
1168−### `++lfe:fl`
1169−
1170−Maximum
1171−
1172−Produces the sum of `emx:fl` plus `prc:fl`.
1173−
1174−#### Source
1175−
1176−```hoon
1177− ++ lfe (sum:si emx (sun:si prc)) :: 2^lfe is > than all
1178−```
1179−
1180−#### Examples
1181−
1182−```
1183− > lfe:fl
1184− --16.384
1185−```
1186−
1187−---
1188−### `++zer:fl`
1189−
1190−Zero
1191−
1192−Produces zero represented as a float.
1193−
1194−#### Source
1195−
1196−```hoon
1197− ++ zer [e=--0 a=0]
1198− --
1199− |%
1200−```
1201−
1202−#### Examples
1203−
1204−```
1205− > zer:fl
1206− [e=--0 a=0]
1207−```
1208−
1209−---
1210−### `++rou:fl`
1211−
1212−Round
1213−
1214−Rounds `a`. The way in which `a` is rounded depends on the value of `r:fl`.
1215−
1216−#### Accepts
1217−
1218−`a` is an `fn`.
1219−
1220−#### Produes
1221−
1222−An `fn`.
1223−
1224−#### Source
1225−
1226−```hoon
1227− ++ rou
1228− |= [a=fn] ^- fn
1229− ?. ?=([$f *] a) a
1230− ?~ a.a [%f s.a zer]
1231− ?: s.a (^rou +>.a)
1232− =.(r swr (fli (^rou +>.a)))
1233−```
1234−
1235−#### Examples
1236−
1237−```
1238− > =a 10.161.487.211.429.486.882.397.572.894.294.017.777
1239− > (rou:fl [%f & --12 a])
1240− [%f s=%.y e=--22 a=9.923.327.354.911.608.283.591.379.779.584.002]
1241−
1242− > (rou:fl [%f & --12 (add a 1)])
1243− [%f s=%.y e=--22 a=9.923.327.354.911.608.283.591.379.779.584.002]
1244−
1245− > (rou:fl [%f & --12 (add a 300)])
1246− [%f s=%.y e=--22 a=9.923.327.354.911.608.283.591.379.779.584.002]
1247−
1248− > (rou:fl [%f & --12 (add a 1.000)])
1249− [%f s=%.y e=--22 a=9.923.327.354.911.608.283.591.379.779.584.003]
1250−```
1251−
1252−---
1253−### `++syn:fl`
1254−
1255−Get sign
1256−
1257−Produces the sign of `a`.
1258−
1259−#### Accepts
1260−
1261−`a` is an `fn`.
1262−
1263−#### Produes
1264−
1265−An `fn`.
1266−
1267−#### Source
1268−
1269−```hoon
1270− ++ syn
1271− |= [a=fn] ^- ?
1272− ?-(-.a $f s.a, $i s.a, $n &)
1273−```
1274−
1275−#### Examples
1276−
1277−```
1278− > (syn:fl (sun:fl 106))
1279− %.y
1280−
1281− > (syn:fl [%f | --0 106])
1282− %.n
1283−```
1284−
1285−---
1286−### `++abs:fl`
1287−
1288−Absolute value
1289−
1290−Produces the absolute value of `a`.
1291−
1292−#### Accepts
1293−
1294−`a` is an `fn`.
1295−
1296−#### Produes
1297−
1298−An `fn`.
1299−
1300−#### Sources
1301−
1302−```hoon
1303− ++ abs
1304− |= [a=fn] ^- fn
1305− ?: ?=([$f *] a) [%f & e.a a.a]
1306− ?: ?=([$i *] a) [%i &] [%n ~]
1307−```
1308−
1309−#### Examples
1310−
1311−```
1312− > (abs:fl [%f | --0 106])
1313− [%f s=%.y e=--0 a=106]
1314−
1315− > (abs:fl [%f & --0 106])
1316− [%f s=%.y e=--0 a=106]
1317−```
1318−
1319−---
1320−### `++add:fl`
1321−
1322−Add
1323−
1324−Produces the sum of `a` plus `b`.
1325−
1326−#### Accepts
1327−
1328−`a` is an `fn`.
1329−
1330−`b` is an `fn`.
1331−
1332−#### Produces
1333−
1334−An `fn`.
1335−
1336−#### Source
1337−
1338−```hoon
1339− ++ add
1340− |= [a=fn b=fn] ^- fn
1341− ?: |(?=([$n *] a) ?=([$n *] b)) [%n ~]
1342− ?: |(?=([$i *] a) ?=([$i *] b))
1343− ?: &(?=([$i *] a) ?=([$i *] b))
1344− ?: =(a b) a [%n ~]
1345− ?: ?=([$i *] a) a b
1346− ?: |(=(a.a 0) =(a.b 0))
1347− ?. &(=(a.a 0) =(a.b 0)) %- rou ?~(a.a b a)
1348− [%f ?:(=(r %d) &(s.a s.b) |(s.a s.b)) zer]
1349− %- |= [a=fn]
1350− ?. ?=([$f *] a) a
1351− ?. =(a.a 0) a
1352− [%f !=(r %d) zer]
1353− ?: =(s.a s.b)
1354− ?: s.a (^add +>.a +>.b |)
1355− =.(r swr (fli (^add +>.a +>.b |)))
1356− ?: s.a (^sub +>.a +>.b |)
1357− (^sub +>.b +>.a |)
1358−```
1359−
1360−#### Examples
1361−
1362−```
1363− > (add:fl [%f & --0 106] [%f | --3 55])
1364− [%f s=%.n e=-104 a=6.774.324.807.619.657.921.598.381.929.529.344]
1365−```
1366−
1367−---
1368−### `++ead:fl`
1369−
1370−Exact add
1371−
1372−Produces the exact sum of `a` plus `b`.
1373−
1374−#### Accepts
1375−
1376−`a` is an `fn`.
1377−
1378−`b` is an `fn`.
1379−
1380−#### Produces
1381−
1382−An `fn`.
1383−
1384−#### Source
1385−
1386−```hoon
1387− ++ ead
1388− |= [a=fn b=fn] ^- fn
1389− ?: |(?=([$n *] a) ?=([$n *] b)) [%n ~]
1390− ?: |(?=([$i *] a) ?=([$i *] b))
1391− ?: &(?=([$i *] a) ?=([$i *] b))
1392− ?: =(a b) a [%n ~]
1393− ?: ?=([$i *] a) a b
1394− ?: |(=(a.a 0) =(a.b 0))
1395− ?. &(=(a.a 0) =(a.b 0)) ?~(a.a b a)
1396− [%f ?:(=(r %d) &(s.a s.b) |(s.a s.b)) zer]
1397− %- |= [a=fn]
1398− ?. ?=([$f *] a) a
1399− ?. =(a.a 0) a
1400− [%f !=(r %d) zer]
1401− ?: =(s.a s.b)
1402− ?: s.a (^add +>.a +>.b &)
1403− (fli (^add +>.a +>.b &))
1404− ?: s.a (^sub +>.a +>.b &)
1405− (^sub +>.b +>.a &)
1406− ::
1407−```
1408−
1409−#### Examples
1410−
1411−```
1412− > (ead:fl [%f & --0 106] [%f | --3 55])
1413− [%f s=%.n e=--0 a=334]
1414−```
1415−
1416−---
1417−### `++sub:fl`
1418−
1419−Subtract
1420−
1421−Produces the difference of `a` minus `b`.
1422−
1423−#### Accepts
1424−
1425−`a` is an `fn`.
1426−
1427−`b` is an `fn`.
1428−
1429−#### Produces
1430−
1431−An `fn`.
1432−
1433−#### Source
1434−
1435−```hoon
1436− ++ sub
1437− |= [a=fn b=fn] ^- fn (add a (fli b))
1438−```
1439−
1440−#### Examples
1441−
1442−```
1443− > (sub:fl [%f & --13 2.718] [%f & --23 11])
1444− [%f s=%.n e=-86 a=5.416.671.014.775.224.232.595.412.796.571.648]
1445−```
1446−
1447−---
1448−### `++mul:fl`
1449−
1450−Multiply
1451−
1452−Produces the product of `a` multiplied by `b`.
1453−
1454−#### Accepts
1455−
1456−`a` is an `fn`.
1457−
1458−`b` is an `fn`.
1459−
1460−#### Produces
1461−
1462−An `fn`.
1463−
1464−#### Source
1465−
1466−```hoon
1467− ++ mul
1468− |= [a=fn b=fn] ^- fn
1469− ?: |(?=([$n *] a) ?=([$n *] b)) [%n ~]
1470− ?: ?=([$i *] a)
1471− ?: ?=([$i *] b)
1472− [%i =(s.a s.b)]
1473− ?: =(a.b 0) [%n ~] [%i =(s.a s.b)]
1474− ?: ?=([$i *] b)
1475− ?: =(a.a 0) [%n ~] [%i =(s.a s.b)]
1476− ?: |(=(a.a 0) =(a.b 0)) [%f =(s.a s.b) zer]
1477− ?: =(s.a s.b) (^mul +>.a +>.b)
1478− =.(r swr (fli (^mul +>.a +>.b)))
1479−```
1480−
1481−---
1482−### `++emu:fl`
1483−
1484−Exact multiply
1485−
1486−Produces the exact product of `a` multiplied by `b`.
1487−
1488−#### Accepts
1489−
1490−`a` is an `fn`.
1491−
1492−`b` is an `fn`.
1493−
1494−#### Produces
1495−
1496−An `fn`.
1497−
1498−#### Examples
1499−
1500−```
1501− ++ emu
1502− |= [a=fn b=fn] ^- fn
1503− ?: |(?=([$n *] a) ?=([$n *] b)) [%n ~]
1504− ?: ?=([$i *] a)
1505− ?: ?=([$i *] b)
1506− [%i =(s.a s.b)]
1507− ?: =(a.b 0) [%n ~] [%i =(s.a s.b)]
1508− ?: ?=([$i *] b)
1509− ?: =(a.a 0) [%n ~] [%i =(s.a s.b)]
1510− ?: |(=(a.a 0) =(a.b 0)) [%f =(s.a s.b) zer]
1511− [%f =(s.a s.b) (sum:si e.a e.b) (^^mul a.a a.b)]
1512−```
1513−
1514−---
1515−### `++div:fl`
1516−
1517−Divide
1518−
1519−Produces the quotient of `a` divided by `b`.
1520−
1521−#### Accepts
1522−
1523−`a` is an `fn`.
1524−
1525−`b` is an `fn`.
1526−
1527−#### Produces
1528−
1529−An `fn`.
1530−
1531−#### Divide
1532−
1533−```hoon
1534− ++ div
1535− |= [a=fn b=fn] ^- fn
1536− ?: |(?=([$n *] a) ?=([$n *] b)) [%n ~]
1537− ?: ?=([$i *] a)
1538− ?: ?=([$i *] b) [%n ~] [%i =(s.a s.b)]
1539− ?: ?=([$i *] b) [%f =(s.a s.b) zer]
1540− ?: =(a.a 0) ?: =(a.b 0) [%n ~] [%f =(s.a s.b) zer]
1541− ?: =(a.b 0) [%i =(s.a s.b)]
1542− ?: =(s.a s.b) (^div +>.a +>.b)
1543− =.(r swr (fli (^div +>.a +>.b)))
1544−```
1545−
1546−---
1547−### `++fma:fl`
1548−
1549−Fused multiply-add
1550−
1551−Produces the sum of `c` plus the product of `a` multiplied by `b`;
1552−`(a * b) + c`.
1553−
1554−#### Accepts
1555−
1556−`a` is an `fn`.
1557−
1558−`b` is an `fn`.
1559−
1560−`c` is an `fn`.
1561−
1562−#### Produces
1563−
1564−An `fn`.
1565−
1566−#### Source
1567−
1568−```hoon
1569− ++ fma
1570− |= [a=fn b=fn c=fn] ^- fn
1571− (add (emu a b) c)
1572−```
1573−
1574−#### Examples
1575−
1576−```
1577− > (fma:fl [%f & --13 2.718] [%f & --23 11] [%f & --13 2.718])
1578− [%f s=%.y e=-62 a=9.475.054.514.089.037.465.004.673.635.188.736]=
1579−```
1580−
1581−---
1582−### `++sqt:fl`
1583−
1584−Square root
1585−
1586−Produces the square root of `a`.
1587−
1588−#### Accepts
1589−
1590−`a` is an `fn`.
1591−
1592−#### Produces
1593−
1594−An `fn`.
1595−
1596−#### Source
1597−
1598−```hoon
1599− ++ sqt
1600− |= [a=fn] ^- fn
1601− ?: ?=([$n *] a) [%n ~]
1602− ?: ?=([$i *] a) ?:(s.a a [%n ~])
1603− ?~ a.a [%f s.a zer]
1604− ?: s.a (^sqt +>.a) [%n ~]
1605−```
1606−
1607−#### Examples
1608−
1609−```
1610− > (sqt:fl [%f s=%.y e=-18 a=342.602.577])
1611− [%f s=%.y e=-107 a=5.865.903.143.604.945.574.132.671.852.050.553]
1612−```
1613−
1614−---
1615−### `++inv:fl`
1616−
1617−Inverse
1618−
1619−Produces the inverse of `a` by dividing `1` by `a`.
1620−
1621−#### Accepts
1622−
1623−`a` is an `fn`.
1624−
1625−#### Produces
1626−
1627−An `fn`.
1628−
1629−#### Source
1630−
1631−```hoon
1632− ++ inv
1633− |= [a=fn] ^- fn
1634− (div [%f & --0 1] a)
1635−```
1636−
1637−#### Examples
1638−
1639−```
1640− > (inv:fl [%f s=%.y e=--0 a=10])
1641− [%f s=%.y e=-116 a=8.307.674.973.655.724.205.648.794.126.752.154]
1642− > (drg:fl [%f s=%.y e=-116 a=8.307.674.973.655.724.205.648.794.126.752.154])
1643− [%d s=%.y e=-1 a=1]
1644−
1645− > (inv:fl [%f s=%.y e=--1 a=10])
1646− [%f s=%.y e=-117 a=8.307.674.973.655.724.205.648.794.126.752.154]
1647− > (drg:fl [%f s=%.y e=-117 a=8.307.674.973.655.724.205.648.794.126.752.154])
1648− [%d s=%.y e=-2 a=5]
1649−
1650− > (inv:fl [%f s=%.y e=--2 a=10])
1651− [%f s=%.y e=-118 a=8.307.674.973.655.724.205.648.794.126.752.154]
1652− > (drg:fl [%f s=%.y e=-118 a=8.307.674.973.655.724.205.648.794.126.752.154])
1653− [%d s=%.y e=-3 a=25]
1654−```
1655−
1656−---
1657−### `++sun:fl`
1658−
1659−Signed integer to float
1660−
1661−Produces `a` in floating-point representation.
1662−
1663−#### Accepts
1664−
1665−`a` is an unsigned integer.
1666−
1667−#### Produces
1668−
1669−An `fn`.
1670−
1671−#### Source
1672−
1673−```hoon
1674− ++ sun
1675− |= [a=@u] ^- fn
1676− (rou [%f & --0 a])
1677−```
1678−
1679−#### Examples
1680−
1681−```
1682− > (sun:fl 0)
1683− [%f s=%.y e=--0 a=0]
1684−
1685− > (sun:fl 5.048.729)
1686− [%f s=%.y e=-90 a=6.250.023.776.601.238.669.911.180.544.311.296]
1687−
1688− > (sun:fl -100)
1689− ! exit
1690−```
1691−
1692−---
1693−### `++san:fl`
1694−
1695−Signed integer to float
1696−
1697−Produces the floating-point representation of `a`, an unsigned integer.
1698−
1699−#### Accepts
1700−
1701−`a` is an unsigned integer.
1702−
1703−#### Produces
1704−
1705−An `fn`.
1706−
1707−#### Source
1708−
1709−```hoon
1710− ++ san
1711− |= [a=@s] ^- fn
1712− =+ b=(old:si a)
1713− (rou [%f -.b --0 +.b])
1714−```
1715−
1716−#### Examples
1717−
1718−```
1719− > (san:fl --100)
1720− [%f s=%.y e=-106 a=8.112.963.841.460.668.169.578.900.514.406.400]
1721−
1722− > (san:fl -100)
1723− [%f s=%.n e=-106 a=8.112.963.841.460.668.169.578.900.514.406.400]
1724−```
1725−
1726−---
1727−### `++lth:fl`
1728−
1729−Less than
1730−
1731−Tests if `a` is less than `b`. Returns `~` in the event of `a` or `b` being a
1732−NaN (`[%n ~]`).
1733−
1734−#### Accepts
1735−
1736−`a` is an `fn`.
1737−
1738−`b` is an `fn`.
1739−
1740−#### Produces
1741−
1742−A `unit` of `flag`.
1743−
1744−#### Source
1745−
1746−```hoon
1747− ++ lth
1748− |= [a=fn b=fn] ^- (unit ?)
1749− ?: |(?=([$n *] a) ?=([$n *] b)) ~ :- ~
1750− ?: =(a b) |
1751− ?: ?=([$i *] a) !s.a ?: ?=([$i *] b) s.b
1752− ?: |(=(a.a 0) =(a.b 0))
1753− ?: &(=(a.a 0) =(a.b 0)) |
1754− ?: =(a.a 0) s.b !s.a
1755− ?: !=(s.a s.b) s.b
1756− ?: s.a (^lth +>.a +>.b) (^lth +>.b +>.a)
1757−```
1758−
1759−#### Examples
1760−
1761−```
1762− > (lth:fl (sun:fl 116) (sun:fl 4.820))
1763− [~ u=%.y]
1764−
1765− > (lth:fl (sun:fl 218.116) (sun:fl 4.820))
1766− [~ u=%.n]
1767−
1768− > (lth:fl (sun:fl 218.116) [%n ~])
1769− ~
1770−```
1771−
1772−---
1773−### `++lte:fl`
1774−
1775−Less than or equal
1776−
1777−Tests whether `a` is less than or equal to `b`. Returns `~` in the event of `a`
1778−or `b` being a NaN (`[%n ~]`).
1779−
1780−#### Accepts
1781−
1782−`a` is an `fn`.
1783−
1784−`b` is an `fn`.
1785−
1786−#### Produces
1787−
1788−A `unit` of `flag`.
1789−
1790−#### Source
1791−
1792−```hoon
1793− ++ lte
1794− |= [a=fn b=fn] ^- (unit ?)
1795− %+ bind (lth b a) |= a=? !a
1796−```
1797−
1798−#### Examples
1799−
1800−```
1801− > (lte:fl (sun:fl 102) [%f %.y -5 973.655.724])
1802− [~ u=%.y]
1803−
1804− > (lte:fl (sun:fl 102) [%f %.y -24 973.655.724])
1805− [~ u=%.n]
1806−
1807− > (lte:fl [%f %.y --2 25] (sun:fl 100))
1808− [~ u=%.y]
1809−
1810− > (lte:fl [%f %.y --2 25] [%f %.y --3 2])
1811− [~ u=%.n]
1812−
1813− > (lte:fl [%f %.y --2 25] [%n ~])
1814− ~
1815−```
1816−
1817−---
1818−### `++equ:fl`
1819−
1820−Equals
1821−
1822−Tests if `a` is equal to `b`. Returns `~` in the event of `a` or `b` being a NaN
1823−(`[%n ~]`).
1824−
1825−#### Accepts
1826−
1827−`a` is an `fn`.
1828−
1829−`b` is an `fn`.
1830−
1831−#### Produces
1832−
1833−An `unit` of `flag`.
1834−
1835−#### Source
1836−
1837−```hoon
1838− ++ equ
1839− |= [a=fn b=fn] ^- (unit ?)
1840− ?: |(?=([$n *] a) ?=([$n *] b)) ~ :- ~
1841− ?: =(a b) &
1842− ?: |(?=([$i *] a) ?=([$i *] b)) |
1843− ?: |(=(a.a 0) =(a.b 0))
1844− ?: &(=(a.a 0) =(a.b 0)) & |
1845− ?: |(=(e.a e.b) !=(s.a s.b)) |
1846− (^equ +>.a +>.b)
1847−```
1848−
1849−#### Examples
1850−
1851−```
1852− > (equ:fl [%f %.y --2 25] (sun:fl 100))
1853− [~ u=%.y]
1854−
1855− > (equ:fl [%f %.y --2 25] (sun:fl 101))
1856− [~ u=%.n]
1857−```
1858−
1859−---
1860−### `++gte:fl`
1861−
1862−Greater or equal than
1863−
1864−Tests whether `a` is greater than or equal to `b`. Returns `~` in the event of
1865−`a` or `b` being a NaN (`[%n ~]`).
1866−
1867−#### Accepts
1868−
1869−`a` is an `fn`.
1870−
1871−`b` is an `fn`.
1872−
1873−#### Produces
1874−
1875−An `unit` of `flag`.
1876−
1877−#### Source
1878−
1879−```hoon
1880− ++ gte
1881− |= [a=fn b=fn] ^- (unit ?) (lte b a)
1882−```
1883−
1884−#### Examples
1885−
1886−```
1887− > (gte:fl [%f %.y --2 25] (sun:fl 100))
1888− [~ u=%.y]
1889−
1890− > (gth:fl [%f %.y --6 73.989] [%f %.y --5 919.599])
1891− [~ u=%.n]
1892−
1893− > (gth:fl [%f %.y --6 73.989] [%n ~])
1894− ~
1895−```
1896−
1897−---
1898−### `++gth:fl`
1899−
1900−Greater than
1901−
1902−Tests whether `a` is greater than `b`. Returns `~` in the event of `a` or `b`
1903−being a NaN (`[%n ~]`).
1904−
1905−#### Accepts
1906−
1907−`a` is an `fn`.
1908−
1909−`b` is an `fn`.
1910−
1911−#### Produces
1912−
1913−An `unit` of `flag`.
1914−
1915−#### Source
1916−
1917−```hoon
1918− ++ gth
1919− |= [a=fn b=fn] ^- (unit ?) (lth b a)
1920−```
1921−
1922−#### Examples
1923−
1924−```
1925− > (gth:fl [%f %.y --2 25] (sun:fl 100))
1926− [~ u=%.n]
1927−
1928− > (gth:fl [%f %.y --6 73.989] [%f %.y --5 119.599])
1929− [~ u=%.y]
1930−```
1931−
1932−---
1933−### `++drg:fl`
1934−
1935−Float to decimal
1936−
1937−Produces the decimal form of `a` using the Dragon4 algorithm. Guarantees
1938−accurate results for rounded floats.
1939−
1940−#### Accepts
1941−
1942−`a` is an `fn`.
1943−
1944−#### Produces
1945−
1946−A `dn`.
1947−
1948−#### Source
1949−
1950−```hoon
1951− ++ drg
1952− |= [a=fn] ^- dn
1953− ?: ?=([$n *] a) [%n ~]
1954− ?: ?=([$i *] a) [%i s.a]
1955− ?~ a.a [%d s.a --0 0]
1956− [%d s.a (^drg +>.a)]
1957−```
1958−
1959−#### Examples
1960−
1961−```
1962− > (drg:fl [%f | --6 73.989])
1963− [%d s=%.n e=--0 a=4.735.296]
1964−```
1965−
1966−---
1967−### `++grd:fl`
1968−
1969−Decimal to float
1970−
1971−Converts decimal `a` to `fn`.
1972−
1973−#### Accepts
1974−
1975−`a` is a `dn`.
1976−
1977−#### Produces
1978−
1979−An `fn`.
1980−
1981−#### Source
1982−
1983−```hoon
1984− ++ grd
1985− |= [a=dn] ^- fn
1986− ?: ?=([$n *] a) [%n ~]
1987− ?: ?=([$i *] a) [%i s.a]
1988− => .(r %n)
1989− =+ q=(abs:si e.a)
1990− ?: (syn:si e.a)
1991− (mul [%f s.a --0 a.a] [%f & e.a (pow 5 q)])
1992− (div [%f s.a --0 a.a] [%f & (sun:si q) (pow 5 q)])
1993−```
1994−
1995−#### Examples
1996−
1997−```
1998− > (grd:fl [%d s=%.n e=--0 a=73.989])
1999− [%f s=%.n e=-96 a=5.862.012.516.267.904.074.208.723.341.410.304]
2000−
2001− > (grd:fl [%d s=%.n e=--0 a=100])
2002− [%f s=%.n e=-106 a=8.112.963.841.460.668.169.578.900.514.406.400]
2003−```
2004−
2005−---
2006−### `++toi:fl`
2007−
2008−Round to signed integer
2009−
2010−Rounds `a` to the nearest signed integer.
2011−
2012−#### Accepts
2013−
2014−`a` is an `fn`.
2015−
2016−#### Produces
2017−
2018−A `unit` of @s.
2019−
2020−#### Source
2021−
2022−```hoon
2023− ++ toi
2024− |= [a=fn] ^- (unit @s)
2025− =+ b=(toj a)
2026− ?. ?=([$f *] b) ~ :- ~
2027− =+ c=(^^mul (bex (abs:si e.b)) a.b)
2028− (new:si s.b c)
2029−```
2030−
2031−#### Examples
2032−
2033−```
2034− > (toi:fl [%f s=%.y e=-78 a=8.112.963.841.460.668.169.578.900.514.406.400])
2035− [~ u=--26.843.545.600]
2036−```
2037−
2038−---
2039−### `++toj:fl`
2040−
2041−Round to integer fn
2042−
2043−Rounds `a` to the nearest decimal integer.
2044−
2045−#### Accepts
2046−
2047−`a` is an `fn`.
2048−
2049−#### Produces
2050−
2051−A `unit` of @s.
2052−
2053−#### Source
2054−
2055−```hoon
2056− ++ toj
2057− |= [a=fn] ^- fn
2058− ?. ?=([$f *] a) a
2059− ?~ a.a [%f s.a zer]
2060− ?: s.a (^toj +>.a)
2061− =.(r swr (fli (^toj +>.a)))
2062− --
2063−```
2064−
2065−#### Examples
2066−
2067−```
2068− > (toj:fl [%f s=%.y e=-78 a=8.112.963.841.460.668.169.578.900.514.406.400])
2069− [%f s=%.y e=--0 a=26.843.545.600]
2070−
2071− > (toj:fl [%f s=%.y e=-78 a=8.112.963.841.460.668.169.578.900.514])
2072− [%f s=%.y e=--0 a=26.844]
2073−
2074− > (toj:fl [%f s=%.y e=-78 a=8.112.963.841.460])
2075− [%f s=%.y e=--0 a=0]
2076−
2077− > (toj:fl [%f s=%.y e=-9 a=9.002])
2078− [%f s=%.y e=--0 a=16]
2079−```
2080−
2081−---
2082−### `++ff`
2083−
2084−IEEE-754 Formatting
2085−
2086−Container core for IEEE-754 formatting operations.
2087−
2088−- `w` is width: The number of bits in the exponent field.
2089−- `p` is precision: The number of bits in the significand field.
2090−- `w` is bias: Added to exponent when storing.
2091−- `r` is rounding mode: Possible modes are nearest (`$n`), up (`$u`),
2092− down (`$d`), to zero (`$z`), and away from zero (`$a`). Default value is `%a`.
2093−
2094−#### Source
2095−
2096−```hoon
2097− ++ ff
2098− |_ [[w=@u p=@u b=@s] r=$?($n $u $d $z $a)]
2099−```
2100−
2101−#### Examples
2102−
2103−```
2104− > =ffcore ~(. ff [8 8 0] %n)
2105− > ffcore
2106− <24.ltg {{{@ud @ud @ud} r/$n} <54.tyv 119.wim 31.ohr 1.jmk $143>}>
2107− >
2108−```
2109−
2110−---
2111−#### Discussion
2112−
2113−`++ff` has no use outside of the functionality provided to other cores: `++rd`,
2114−`++rs`, `++rq`, and `++rh`. It's not intended to be used directly; it's just
2115−meant to power those cores.
2116−
2117−---
2118−### `++sb:ff`
2119−
2120−Sign bit
2121−
2122−Produces the sign bit of `++ff`.
2123−
2124−#### Source
2125−
2126−```hoon
2127− ++ sb (bex (^add w p))
2128−```
2129−
2130−#### Examples
2131−
2132−```
2133− > sb:ff
2134− 1
2135−```
2136−
2137−---
2138−### `++me:ff`
2139−
2140−Minimum exponent
2141−
2142−Produces the minimum possible exponent of `ff`.
2143−
2144−#### Source
2145−
2146−```hoon
2147− ++ me (dif:si (dif:si --1 b) (sun:si p))
2148−```
2149−
2150−#### Examples
2151−
2152−```
2153− > me:ff
2154− --1
2155−```
2156−
2157−---
2158−### `++pa:ff`
2159−
2160−Initialize `fl`
2161−
2162−Instantiates the core `fl`, giving values to its samples based on the
2163−configuration of the `ff` core.
2164−
2165−#### Source
2166−
2167−```hoon
2168− ++ pa
2169− %*(. fl p +(p), v me, w (^sub (bex w) 3), d %d, r r)
2170−```
2171−
2172−#### Examples
2173−
2174−```
2175− > ~(pa ff [11 52 --1.023] %n)
2176− < 23.qzd
2177− 28.btz
2178− { {{p/@ v/@s w/@} r/?($n $u $a $d $z) d/$d}
2179− <54.tyv 119.wim 31.ohr 1.jmk $143>
2180− }
2181− >
2182−```
2183−
2184−#### Discussion
2185−
2186−`++pa` exists exclusively for internal use of `++ff`, and `++ff` exists for
2187−internal use in other cores.
2188−
2189−---
2190−### `++sea:ff`
2191−
2192−`@r` to `fn`
2193−
2194−Converts `a` from `@r` to `fn`.
2195−
2196−#### Accepts
2197−
2198−`a` is a `@r`, an IEEE float.
2199−
2200−#### Produces
2201−
2202−A `unit` of @s.
2203−
2204−#### Source
2205−
2206−```hoon
2207− ++ sea
2208− |= [a=@r] ^- fn
2209− =+ [f=(cut 0 [0 p] a) e=(cut 0 [p w] a)]
2210− =+ s=(sig a)
2211− ?: =(e 0)
2212− ?: =(f 0) [%f s --0 0] [%f s me f]
2213− ?: =(e (fil 0 w 1))
2214− ?: =(f 0) [%i s] [%n ~]
2215− =+ q=:(sum:si (sun:si e) me -1)
2216− =+ r=(^add f (bex p))
2217− [%f s q r]
2218−```
2219−
2220−#### Examples
2221−
2222−```
2223− > (sea:ff `@r`0x8)
2224− [%f s=%.y e=--0 a=0]
2225−```
2226−
2227−---
2228−### `++bit:ff`
2229−
2230−`fn` to `@r`, rounding
2231−
2232−Converts `a` from `fn` to `@r` and applies rounding.
2233−
2234−#### Accepts
2235−
2236−`a` is an `fn`.
2237−
2238−#### Produces
2239−
2240−A `@r`.
2241−
2242−#### Source
2243−
2244−```hoon
2245− ++ bit |= [a=fn] (bif (rou:pa a))
2246−```
2247−
2248−#### Examples
2249−
2250−```
2251− > (bit:ma:rd [%f | -6 202])
2252− 0xc009400000000000
2253−```
2254−
2255−---
2256−### `++bif:ff`
2257−
2258−`fn` to `@r`, no rounding
2259−
2260−Converts `a` from `fn` to `@r`. No rounding is applied.
2261−
2262−#### Accepts
2263−
2264−`a` is a `@r`, an IEEE float.
2265−
2266−#### Produces
2267−
2268−A `flag`.
2269−
2270−#### Source
2271−
2272−```hoon
2273− ++ bif
2274− |= [a=fn] ^- @r
2275− ?: ?=([$i *] a)
2276− =+ q=(lsh 0 p (fil 0 w 1))
2277− ?: s.a q (^add q sb)
2278− ?: ?=([$n *] a) (lsh 0 (dec p) (fil 0 +(w) 1))
2279− ?~ a.a ?: s.a `@r`0 sb
2280− =+ ma=(met 0 a.a)
2281− ?. =(ma +(p))
2282− ?> =(e.a me)
2283− ?> (^lth ma +(p))
2284− ?: s.a `@r`a.a (^add a.a sb)
2285− =+ q=(sum:si (dif:si e.a me) --1)
2286− =+ r=(^add (lsh 0 p (abs:si q)) (end 0 p a.a))
2287− ?: s.a r (^add r sb)
2288−```
2289−
2290−#### Examples
2291−
2292−```
2293− > (bif:ma:rd *fn)
2294− 0x7ff8000000000000
2295−```
2296−
2297−---
2298−### `++sig:ff`
2299−
2300−Get sign
2301−
2302−Produces the sign of `a`.
2303−
2304−#### Accepts
2305−
2306−`a` is a `@r`, an IEEE float.
2307−
2308−#### Produces
2309−
2310−A `flag`.
2311−
2312−#### Source
2313−
2314−```hoon
2315− ++ sig
2316− |= [a=@r] ^- ?
2317− =(0 (cut 0 [(^add p w) 1] a))
2318−```
2319−
2320−#### Examples
2321−
2322−```
2323− > (sig:ff `@r`5)
2324− %.n
2325−```
2326−
2327−---
2328−### `++exp:ff`
2329−
2330−Get exponent
2331−
2332−Produces the exponent of `a`.
2333−
2334−#### Accepts
2335−
2336−`a` is a `@r`, an IEEE float.
2337−
2338−#### Produces
2339−
2340−A signed integer.
2341−
2342−#### Source
2343−
2344−```hoon
2345− ++ exp
2346− |= [a=@r] ^- @s
2347− (dif:si (sun:si (cut 0 [p w] a)) b)
2348−```
2349−
2350−#### Examples
2351−
2352−```
2353− > (exp:ff `@r`5)
2354− --0
2355−```
2356−
2357−---
2358−### `++add:ff`
2359−
2360−Add
2361−
2362−Produces the sum of `a` plus `b`.
2363−
2364−#### Accepts
2365−
2366−`a` is a `@r`, an IEEE float.
2367−
2368−`b` is a `@r`, an IEEE float.
2369−
2370−#### Produces
2371−
2372−A `@r`, an IEEE float.
2373−
2374−#### Source
2375−
2376−```hoon
2377− ++ add
2378− |= [a=@r b=@r]
2379− (bif (add:pa (sea a) (sea b)))
2380−```
2381−
2382−#### Examples
2383−
2384−```
2385− > (add:ma:rd `@r`5 `@r`11)
2386− 0x10
2387−```
2388−
2389−---
2390−### `++sub:ff`
2391−
2392−Sub
2393−
2394−Produces the sum of `a` plus `b`.
2395−
2396−#### Accepts
2397−
2398−`a` is a `@r`, an IEEE float.
2399−
2400−`b` is a `@r`, an IEEE float.
2401−
2402−#### Produces
2403−
2404−A `@r`, an IEEE float.
2405−
2406−#### Source
2407−
2408−```hoon
2409− ++ sub
2410− |= [a=@r b=@r]
2411− (bif (sub:pa (sea a) (sea b)))
2412−```
2413−
2414−#### Examples
2415−
2416−```
2417− > (sub:ma:rd `@r`5 `@r`11)
2418− 0x8000000000000006
2419−```
2420−
2421−---
2422−### `++mul:ff`
2423−
2424−Multiply
2425−
2426−Produces the product of `a` multiplied by `b`.
2427−
2428−#### Accepts
2429−
2430−`a` is a `@r`, an IEEE float.
2431−
2432−`b` is a `@r`, an IEEE float.
2433−
2434−#### Produces
2435−
2436−A `@r`, an IEEE float.
2437−
2438−#### Multiply
2439−
2440−```hoon
2441− ++ mul
2442− |= [a=@r b=@r]
2443− (bif (mul:pa (sea a) (sea b)))
2444−```
2445−
2446−#### Examples
2447−
2448−```
2449− > (mul:ma:rd `@r`11 `@r`2)
2450− 0x0
2451−```
2452−
2453−---
2454−### `++div:ff`
2455−
2456−Divide
2457−
2458−Produces the quotient of `a` divided by `b`.
2459−
2460−#### Accepts
2461−
2462−`a` is a `@r`, an IEEE float.
2463−
2464−`b` is a `@r`, an IEEE float.
2465−
2466−#### Produces
2467−
2468−A `@r`, an IEEE float.
2469−
2470−#### Source
2471−
2472−```hoon
2473− ++ div
2474− |= [a=@r b=@r]
2475− (bif (div:pa (sea a) (sea b)))
2476−```
2477−
2478−#### Examples
2479−
2480−```
2481− > (div:ma:rd `@r`175 `@r`26)
2482− 0x401aec4ec4ec4ec4
2483−```
2484−
2485−---
2486−### `++fma:ff`
2487−
2488−Fused multiply-add
2489−
2490−Produces the sum of `c` plus the product of `a` multiplied by `b`;
2491−`(a * b) + c`.
2492−
2493−#### Accepts
2494−
2495−`a` is a `@r`, an IEEE float.
2496−
2497−`b` is a `@r`, an IEEE float.
2498−
2499−`c` is a `@r`, an IEEE float.
2500−
2501−#### Produces
2502−
2503−A `@r`, an IEEE float.
2504−
2505−#### Source
2506−
2507−```hoon
2508− ++ fma
2509− |= [a=@r b=@r c=@r]
2510− (bif (fma:pa (sea a) (sea b) (sea c)))
2511−```
2512−
2513−#### Examples
2514−
2515−```
2516− > (fma:ma:rd `@r`175 `@r`26 `@r`100)
2517− 0x64
2518−```
2519−
2520−---
2521−### `++sqt:ff`
2522−
2523−Square root
2524−
2525−Produces the square root of `a`.
2526−
2527−#### Accepts
2528−
2529−`a` is a `@r`, an IEEE float.
2530−
2531−#### Produces
2532−
2533−A `@r`, an IEEE float.
2534−
2535−#### Source
2536−
2537−```hoon
2538− ++ sqt
2539− |= [a=@r]
2540− (bif (sqt:pa (sea a)))
2541−```
2542−
2543−#### Examples
2544−
2545−```
2546− > (sqt:ma:rd `@r`175)
2547− 0x1e9a751f9447b724
2548−```
2549−
2550−---
2551−### `++lth:ff`
2552−
2553−Less than
2554−
2555−Tests whether `a` is less than `b`.
2556−
2557−#### Accepts
2558−
2559−`a` is a `@r`, an IEEE float.
2560−
2561−`b` is a `@r`, an IEEE float.
2562−
2563−#### Produces
2564−
2565−A `flag`.
2566−
2567−#### Source
2568−
2569−```hoon
2570− ++ lth
2571− |= [a=@r b=@r] (fall (lth:pa (sea a) (sea b)) |)
2572−```
2573−
2574−#### Examples
2575−
2576−```
2577− > (lth:ma:rd `@rd`1 `@rd`2)
2578− %.y
2579−
2580− > (lth:ma:rd `@rd`10 `@rd`2)
2581− %.n
2582−```
2583−
2584−---
2585−### `++lte:ff`
2586−
2587−Less than or equal to
2588−
2589−Tests whether `a` is less than or equal to `b`.
2590−
2591−#### Accepts
2592−
2593−`a` is a `@r`, an IEEE float.
2594−
2595−`b` is a `@r`, an IEEE float.
2596−
2597−#### Produces
2598−
2599−A `flag`.
2600−
2601−#### Source
2602−
2603−```hoon
2604− ++ lte
2605− |= [a=@r b=@r] (fall (lte:pa (sea a) (sea b)) |)
2606−```
2607−
2608−#### Examples
2609−
2610−```
2611− > (lte:ma:rd `@rd`10 `@rd`2)
2612− %.n
2613−
2614− > (lte:ma:rd `@rd`10 `@rd`10)
2615− %.y
2616−```
2617−
2618−---
2619−### `++equ:ff`
2620−
2621−Equals
2622−
2623−Tests whether `a` is equal to `b`.
2624−
2625−#### Accepts
2626−
2627−`a` is a `@r`, an IEEE float.
2628−
2629−`b` is a `@r`, an IEEE float.
2630−
2631−#### Produces
2632−
2633−A `flag`.
2634−
2635−#### Source
2636−
2637−```hoon
2638− ++ equ
2639− |= [a=@r b=@r] (fall (equ:pa (sea a) (sea b)) |)
2640−```
2641−
2642−#### Examples
2643−
2644−```
2645− > (equ:ma:rd `@rd`10 `@rd`2)
2646− %.n
2647−
2648− > (equ:ma:rd `@rd`10 `@rd`10)
2649− %.y
2650−```
2651−
2652−---
2653−### `++gte:ff`
2654−
2655−Greater or equal than
2656−
2657−Tests whether `a` is greater than or equal to `b`.
2658−
2659−#### Accepts
2660−
2661−`a` is a `@r`, an IEEE float.
2662−
2663−`b` is a `@r`, an IEEE float.
2664−
2665−#### Produces
2666−
2667−A `flag`.
2668−
2669−#### Source
2670−
2671−```hoon
2672− ++ gte
2673− |= [a=@r b=@r] (fall (gte:pa (sea a) (sea b)) |)
2674−```
2675−
2676−#### Examples
2677−
2678−```
2679− > (gte:ma:rd `@rd`10 `@rd`10)
2680− %.y
2681−
2682− > (gte:ma:rd `@rd`10 `@rd`11)
2683− %.n
2684−```
2685−
2686−---
2687−### `++gth:ff`
2688−
2689−Greater than
2690−
2691−Tests whether `a` is greater than or equal to `b`.
2692−
2693−#### Accepts
2694−
2695−`a` is a `@r`, an IEEE float.
2696−
2697−`b` is a `@r`, an IEEE float.
2698−
2699−#### Produces
2700−
2701−A `flag`.
2702−
2703−#### Source
2704−
2705−```hoon
2706− ++ gth
2707− |= [a=@r b=@r] (fall (gth:pa (sea a) (sea b)) |)
2708−```
2709−
2710−#### Examples
2711−
2712−```
2713− > (gth:ma:rd `@rd`10 `@rd`10)
2714− %.n
2715−
2716− > (gth:ma:rd `@rd`10 `@rd`9)
2717− %.y
2718−```
2719−
2720−---
2721−### `++sun:ff`
2722−
2723−Unsigned integer to `@r`
2724−
2725−Converts `a` from an unsigned integer (`@u`) to `@r`.
2726−
2727−#### Accepts
2728−
2729−`a` is `@u`, unsigned integer.
2730−
2731−#### Produces
2732−
2733−A `@r`, an IEEE float.
2734−
2735−#### Source
2736−
2737−```hoon
2738− ++ sun
2739− |= [a=@u] (bit [%f & --0 a])
2740−```
2741−
2742−#### Examples
2743−
2744−```
2745− > (sun:ma:rd 658.149.282)
2746− 0x41c39d47d1000000
2747−```
2748−
2749−---
2750−### `++san:ff`
2751−
2752−Signed integer to `@r`
2753−
2754−Converts `a` from a signed integer to `@r`.
2755−
2756−#### Accepts
2757−
2758−`a` is `@s`, an unsigned integer
2759−
2760−#### Produces
2761−
2762−A `@r`, an IEEE float.
2763−
2764−#### Source
2765−
2766−```hoon
2767− ++ san
2768− |= [a=@s] (bit [%f (syn:si a) --0 (abs:si a)])
2769−```
2770−
2771−#### Examples
2772−
2773−```
2774− > (san:ma:rd --10)
2775− 0x4024000000000000
2776−```
2777−
2778−---
2779−### `++toi:ff`
2780−
2781−Round to integer
2782−
2783−Rounds `a` to the nearest signed integer.
2784−
2785−#### Accepts
2786−
2787−`a` is a `@r`, an IEEE float.
2788−
2789−#### Produces
2790−
2791−A `flag` of `@s`.
2792−
2793−#### Source
2794−
2795−```hoon
2796− ++ toi
2797− |= [a=@r] (toi:pa (sea a))
2798−```
2799−
2800−#### Examples
2801−
2802−```
2803− > (toi:ma:rd `@r`0x4af)
2804− [~ u=--0]
2805−```
2806−
2807−---
2808−### `++drg:ff`
2809−
2810−`@r` to decimal float
2811−
2812−Converts `a` from `@r` to `dn` using the Dragon4 algorithm.
2813−
2814−#### Accepts
2815−
2816−`a` is a `@r`, an IEEE float.
2817−
2818−#### Produces
2819−
2820−A `dn`.
2821−
2822−#### Source
2823−
2824−```hoon
2825− ++ drg
2826− |= [a=@r] (drg:pa (sea a))
2827−```
2828−
2829−#### Examples
2830−
2831−```
2832− > (drg:ma:rd `@r`0x41c0)
2833− [%d s=%.y e=-323 a=8.316]
2834−
2835− > (drg:ma:rd (sun:ma:rd 658.149.282))
2836− [%d s=%.y e=--0 a=658.149.282]
2837−```
2838−
2839−---
2840−### `++grd:ff`
2841−
2842−Decimal float to `@r`
2843−
2844−Converts `a` from `dn` to `@r`.
2845−
2846−#### Accepts
2847−
2848−`a` is a `dn`.
2849−
2850−#### Produces
2851−
2852−A `@r`, an IEEE float.
2853−
2854−#### Source
2855−
2856−```hoon
2857− ++ grd
2858− |= [a=dn] (bif (grd:pa a))
2859− --
2860−```
2861−
2862−#### Examples
2863−
2864−```
2865− > (grd:ma:rd [%d s=%.y e=--0 a=658.149.282])
2866− 0x41c39d47d1000000
2867−```
2868−
2869−---
2870−### `++rlyd`
2871−
2872−Prep `@rd` for print
2873−
2874−Converts `a` from a double-precision binary float to decimal64.
2875−
2876−#### Accepts
2877−
2878−`a` is a `@rd`, a double-precision float.
2879−
2880−#### Produces
2881−
2882−A `dn`.
2883−
2884−#### Source
2885−
2886−```hoon
2887− ++ rlyd |= a=@rd ^- dn (drg:rd a)
2888−```
2889−
2890−#### Examples
2891−
2892−```
2893− > (rlyd .~2.4703e-320)
2894− [%d s=%.y e=-324 a=24.703]
2895−```
2896−
2897−---
2898−### `++rlys`
2899−
2900−Prep @rs for print
2901−
2902−Converts `a` from a single-precision binary float to decimal32.
2903−
2904−#### Accepts
2905−
2906−`a` is a `@rs`, a single-precision float.
2907−
2908−#### Produces
2909−
2910−A `dn`.
2911−
2912−#### Source
2913−
2914−```hoon
2915− ++ rlys |= a=@rs ^- dn (drg:rs a)
2916−```
2917−
2918−#### Examples
2919−
2920−```
2921− > (rlys .1.681557e-39)
2922− [%d s=%.y e=-45 a=1.681.557]
2923−```
2924−
2925−---
2926−### `++rlyh`
2927−
2928−Prep `@rh` for print
2929−
2930−Converts `a` from a half-precision binary float to decimal16.
2931−
2932−#### Accepts
2933−
2934−`a` is a `@rh`, a half-precision float.
2935−
2936−#### Produces
2937−
2938−A `dn`.
2939−
2940−#### Source
2941−
2942−```hoon
2943− ++ rlyh |= a=@rh ^- dn (drg:rh a)
2944−```
2945−
2946−#### Examples
2947−
2948−```
2949− > (rlyh .~~3e1)
2950− [%d s=%.y e=--1 a=3]
2951−```
2952−
2953−---
2954−### `++rlyq`
2955−
2956−Prep `@rq` for print
2957−
2958−Converts `a` from a quad-precision binary float to decimal128.
2959−
2960−#### Accepts
2961−
2962−`a` is a `@rq`, a quad-precision float.
2963−
2964−#### Produces
2965−
2966−A `dn`.
2967−
2968−#### Source
2969−
2970−```hoon
2971− ++ rlyq |= a=@rq ^- dn (drg:rq a)
2972−```
2973−
2974−#### Examples
2975−
2976−```
2977− > (rlyq .~~~2.2628017865927756787440310766086816e-4343)
2978− [%d s=%.y e=-4.377 a=22.628.017.865.927.756.787.440.310.766.086.816]
2979−```
2980−
2981−---
2982−### `++ryld`
2983−
2984−Finish parsing `@rd`
2985−
2986−Converts `a` from a decimal float to a double-precision binary float.
2987−
2988−#### Accepts
2989−
2990−`a` is a `dn`.
2991−
2992−#### Produces
2993−
2994−A a `@rd`, a double-precision float.
2995−
2996−#### Source
2997−
2998−```hoon
2999− ++ ryld |= a=dn ^- @rd (grd:rd a)
3000−```
3001−
3002−#### Examples
3003−
3004−```
3005− > (ryld [%d s=%.y e=-324 a=24.703])
3006− .~2.4703e-320
3007−```
3008−
3009−---
3010−### `++ryls`
3011−
3012−Finish parsing `@rs`
3013−
3014−Converts `a` from a decimal float to a single-precision binary float.
3015−
3016−#### Accepts
3017−
3018−`a` is a `dn`.
3019−
3020−#### Produces
3021−
3022−A a `@rs`, a single-precision float.
3023−
3024−#### Source
3025−
3026−```hoon
3027− ++ ryls |= a=dn ^- @rs (grd:rs a)
3028−```
3029−
3030−#### Examples
3031−
3032−```
3033− > (ryls [%d s=%.y e=-324 a=24.703])
3034− .0
3035−
3036− > (ryls [%d s=%.y e=-32 a=24.703])
3037− .2.4703e-28
3038−```
3039−
3040−---
3041−### `++rylh`
3042−
3043−Finish parsing `@rh`
3044−
3045−Converts `a` from a decimal float to a half-precision binary float.
3046−
3047−#### Accepts
3048−
3049−`a` is a `dn`.
3050−
3051−#### Produces
3052−
3053−A a `@rh`, a half-precision float.
3054−
3055−#### Source
3056−
3057−```hoon
3058− ++ rylh |= a=dn ^- @rh (grd:rh a)
3059−```
3060−
3061−#### Examples
3062−
3063−```
3064− > (rylh [%d s=%.y e=--1 a=703])
3065− .~~7.032e3
3066−
3067− > (rylh [%d s=%.y e=--3 a=56])
3068− .~~5.6e4
3069−
3070− > (rylh [%d s=%.y e=--4 a=56])
3071− .~~inf
3072−```
3073−
3074−---
3075−### `++rylq`
3076−
3077−Finish parsing `@rq`
3078−
3079−Converts `a` from a decimal float to a quad-precision binary float.
3080−
3081−#### Accepts
3082−
3083−`a` is a `dn`.
3084−
3085−#### Produces
3086−
3087−A a `@rq`, a quad-precision float.
3088−
3089−#### Source
3090−
3091−```hoon
3092− ++ rylq |= a=dn ^- @rq (grd:rq a)
3093−```
3094−
3095−#### Examples
3096−
3097−```
3098− > (rylq [%d s=%.y e=-324 a=24.703])
3099− .~~~2.4703e-320
3100−```
3101−
3102−---
3103−### `++rd`
3104−
3105−Double-precision fp
3106−
3107−A container core for operations related to double-precision binary floats.
3108−
3109−`++rd` has four rounding modes: round to nearest (`$n`), round up (`$u`), round
3110−down (`$d`), and round to zero (`$z`).
3111−
3112−#### Source
3113−
3114−```hoon
3115− ++ rd
3116− ^?
3117− ~% %rd +> ~
3118− |_ r=$?($n $u $d $z)
3119−```
3120−
3121−---
3122−### `++ma:rd`
3123−
3124−Initialize `ff`
3125−
3126−Instantiates the core `ff`, giving values to its samples based on the
3127−configuration of the `rd` core.
3128−
3129−#### Source
3130−
3131−```hoon
3132− ++ ma
3133− %*(. ff w 11, p 52, b --1.023, r r)
3134−```
3135−
3136−#### Examples
3137−
3138−```
3139− > ~(ma rd %n)
3140− < 24.ltg
3141− {{{w/@ud p/@ud b/@sd} r/?($n $u $d $z)} <54.tyv 119.wim 31.ohr 1.jmk $143>}
3142− >
3143−```
3144−
3145−---
3146−### `++sea:rd`
3147−
3148−`@rd` to `fn`
3149−
3150−Converts `a` from a double-precision binary float to `fn`.
3151−
3152−```hoon
3153− ++ sea :: @rd to fn
3154− |= [a=@rd] (sea:ma a)
3155−```
3156−
3157−#### Examples
3158−
3159−```
3160− > (sea:rd .~4.94066e-319)
3161− [%f s=%.y e=-1.074 a=100.000]
3162−```
3163−
3164−---
3165−### `++bit:rd`
3166−
3167−`fn` to `@rd`
3168−
3169−Converts `a` from `fn` to a double-precision binary float.
3170−
3171−#### Accepts
3172−
3173−`a` is an `fn`.
3174−
3175−#### Produces
3176−
3177−A `@rd`, a double-precision float.
3178−
3179−#### Source
3180−
3181−```hoon
3182− ++ bit
3183− |= [a=fn] ^- @rd (bit:ma a)
3184−```
3185−
3186−#### Examples
3187−
3188−```
3189− > (bit:rd [%f s=%.y e=-1.074 a=100.000])
3190− .~4.94066e-319
3191−```
3192−
3193−---
3194−### `++add:rd`
3195−
3196−Add
3197−
3198−Produces the sum of `a` plus `b`.
3199−
3200−#### Accepts
3201−
3202−`a` is a `@rd`, a double-precision float.
3203−
3204−`b` is a `@rd`, a double-precision float.
3205−
3206−#### Produces
3207−
3208−A `@rd`.
3209−
3210−#### Source
3211−
3212−```hoon
3213− ++ add ~/ %add
3214− |= [a=@rd b=@rd] ^- @rd
3215− ~_ leaf+"rd-fail"
3216− (add:ma a b)
3217−```
3218−
3219−#### Examples
3220−
3221−```
3222− > (add:rd .~3.94066e12 .~9.2846e11)
3223− .~4.86912e12
3224−```
3225−
3226−---
3227−### `++sub:rd`
3228−
3229−Subtract
3230−
3231−Produces the difference of `a` minus `b`.
3232−
3233−#### Accepts
3234−
3235−`a` is a `@rd`, a double-precision float.
3236−
3237−`b` is a `@rd`, a double-precision float.
3238−
3239−#### Produces
3240−
3241−A `@rd`.
3242−
3243−#### Source
3244−
3245−```hoon
3246− ++ sub ~/ %sub
3247− |= [a=@rd b=@rd] ^- @rd
3248− ~_ leaf+"rd-fail"
3249− (sub:ma a b)
3250−```
3251−
3252−#### Examples
3253−
3254−```
3255− > (sub:rd .~7.94069e2 .~1.2846e3)
3256− .~-4.9053099999999995e2
3257−```
3258−
3259−---
3260−### `++mul:rd`
3261−
3262−Multiply
3263−
3264−Produces the product of `a` times `b`.
3265−
3266−#### Accepts
3267−
3268−`a` is a `@rd`, a double-precision float.
3269−
3270−`b` is a `@rd`, a double-precision float.
3271−
3272−#### Produces
3273−
3274−A `@rd`.
3275−
3276−#### Source
3277−
3278−```hoon
3279− ++ mul ~/ %mul
3280− |= [a=@rd b=@rd] ^- @rd
3281− ~_ leaf+"rd-fail"
3282− (mul:ma a b)
3283−```
3284−
3285−#### Examples
3286−
3287−```
3288− > (mul:rd .~7.94069e2 .~1.2246e3)
3289− .~9.724168973999998e5
3290−```
3291−
3292−---
3293−### `++div:rd`
3294−
3295−Divide
3296−
3297−Produces the quotient of `a` divided by `b`.
3298−
3299−#### Accepts
3300−
3301−`a` is a `@rd`, a double-precision float.
3302−
3303−`b` is a `@rd`.
3304−
3305−#### Produces
3306−
3307−A `@rd`.
3308−
3309−#### Source
3310−
3311−```hoon
3312− ++ div ~/ %div
3313− |= [a=@rd b=@rd] ^- @rd
3314− ~_ leaf+"rd-fail"
3315− (div:ma a b)
3316−```
3317−
3318−#### Examples
3319−
3320−```
3321− > (div:rd .~7.94099e2 .~1.2246e3)
3322− .~6.484558223093255e-1
3323−```
3324−
3325−---
3326−### `++fma:rd`
3327−
3328−Fused multiply-add
3329−
3330−Produces the sum of `c` plus the product of `a` multiplied by `b`;
3331−`(a * b) + c`.
3332−
3333−#### Accepts
3334−
3335−`a` is a `@rd`, an IEEE float.
3336−
3337−`b` is a `@rd`.
3338−
3339−`c` is a `@rd`.
3340−
3341−#### Produces
3342−
3343−A `@rd`.
3344−
3345−#### Source
3346−
3347−
3348−#### Source
3349−
3350−```hoon
3351− ++ fma ~/ %fma
3352− |= [a=@rd b=@rd c=@rd] ^- @rd
3353− ~_ leaf+"rd-fail"
3354− (fma:ma a b c)
3355−```
3356−
3357−#### Examples
3358−
3359−```
3360− > (fma:rd .~7.94099e2 .~1.2246e3 .~3.94066e3)
3361− .~9.763942954e5
3362−```
3363−
3364−---
3365−### `++sqt:rd`
3366−
3367−Square root
3368−
3369−Produces the square root of `a`.
3370−
3371−#### Accepts
3372−
3373−`a` is a `@rd`, a double-precision float.
3374−
3375−#### Produces
3376−
3377−A `@rd`.
3378−
3379−#### Source
3380−
3381−```hoon
3382− ++ sqt ~/ %sqt
3383− |= [a=@rd] ^- @rd ~_ leaf+"rd-fail"
3384− (sqt:ma a)
3385−```
3386−
3387−#### Examples
3388−
3389−```
3390− > (sqt:rd .~3.94066e3)
3391− .~6.2774676422901614e1
3392−```
3393−
3394−---
3395−### `++lth:rd`
3396−
3397−Less than
3398−
3399−Test whether `a` is less than `b`.
3400−
3401−#### Accepts
3402−
3403−`a` is a `@rd`, a double-precision float.
3404−
3405−`b` is a `@rd`, a double-precision float.
3406−
3407−#### Produces
3408−
3409−A `@rd`.
3410−
3411−#### Source
3412−
3413−```hoon
3414− ++ lth ~/ %lth
3415− |= [a=@rd b=@rd]
3416− ~_ leaf+"rd-fail"
3417− (lth:ma a b)
3418−```
3419−
3420−#### Examples
3421−
3422−```
3423− > (lth:rd .~7.94099e2 .~1.2246e3)
3424− %.y
3425−
3426− > (lth:rd .~7.94099e2 .~1.2246e2)
3427− %.n
3428−
3429− > (lth:rd .~1.2246e2 .~1.2246e2)
3430− %.n
3431−```
3432−
3433−---
3434−### `++lte:rd`
3435−
3436−Less than or equal
3437−
3438−Test whether `a` is less than or equal to `b`.
3439−
3440−#### Accepts
3441−
3442−`a` is a `@rd`, a double-precision float.
3443−
3444−`b` is a `@rd`, a double-precision float.
3445−
3446−#### Produces
3447−
3448−A `@rd`.
3449−
3450−#### Source
3451−
3452−```hoon
3453− ++ lte ~/ %lte :: less-equals
3454− |= [a=@rd b=@rd]
3455− ~_ leaf+"rd-fail"
3456− (lte:ma a b)
3457−```
3458−
3459−#### Examples
3460−
3461−```
3462− > (lte:rd .~7.94099e2 .~1.2246e3)
3463− %.y
3464−
3465− > (lte:rd .~7.94099e2 .~1.2246e2)
3466− %.n
3467−
3468− > (lte:rd .~1.2246e2 .~1.2246e2)
3469− %.y
3470−```
3471−
3472−---
3473−### `++equ:rd`
3474−
3475−Equals
3476−
3477−Test whether `a` is equal to `b`.
3478−
3479−#### Accepts
3480−
3481−`a` is a `@rd`, a double-precision float.
3482−
3483−`b` is a `@rd`, a double-precision float.
3484−
3485−#### Produces
3486−
3487−A `@rd`.
3488−
3489−#### Source
3490−
3491−```hoon
3492− ++ equ ~/ %equ
3493− |= [a=@rd b=@rd]
3494− ~_ leaf+"rd-fail"
3495− (equ:ma a b)
3496−```
3497−
3498−#### Examples
3499−
3500−```
3501− > (equ:rd .~7.94099e2 .~1.2246e3)
3502− %.n
3503−
3504− > (equ:rd .~7.94099e2 .~1.2246e2)
3505− %.n
3506−
3507− > (equ:rd .~1.2246e2 .~1.2246e2)
3508− %.y
3509−```
3510−
3511−---
3512−### `++gte:rd`
3513−
3514−Greater than or equal
3515−
3516−Test whether `a` is greater than or equal to `b`.
3517−
3518−#### Accepts
3519−
3520−`a` is a `@rd`, a double-precision float.
3521−
3522−`b` is a `@rd`, a double-precision float.
3523−
3524−#### Produces
3525−
3526−A `@rd`.
3527−
3528−#### Source
3529−
3530−```hoon
3531− ++ gte ~/ %gte
3532− |= [a=@rd b=@rd]
3533− ~_ leaf+"rd-fail"
3534− (gte:ma a b)
3535−```
3536−
3537−#### Examples
3538−
3539−```
3540− > (gte:rd .~7.94099e2 .~1.2246e3)
3541− %.n
3542−
3543− > (gte:rd .~7.94099e2 .~1.2246e2)
3544− %.y
3545−
3546− > (gte:rd .~1.2246e2 .~1.2246e2)
3547− %.y
3548−```
3549−
3550−---
3551−### `++gth:rd`
3552−
3553−Greater than
3554−
3555−Test whether `a` is greater `b`.
3556−
3557−#### Accepts
3558−
3559−`a` is a `@rd`, a double-precision float.
3560−
3561−`b` is a `@rd`, a double-precision float.
3562−
3563−#### Produces
3564−
3565−A `@rd`.
3566−
3567−#### Source
3568−
3569−```hoon
3570− ++ gth ~/ %gth
3571− |= [a=@rd b=@rd]
3572− ~_ leaf+"rd-fail"
3573− (gth:ma a b)
3574−```
3575−
3576−#### Examples
3577−
3578−```
3579− > (gth:rd .~7.94099e2 .~1.2246e3)
3580− %.n
3581−
3582− > (gth:rd .~7.94099e2 .~1.2246e2)
3583− %.y
3584−
3585− > (gth:rd .~1.2246e2 .~1.2246e2)
3586− %.n
3587−```
3588−
3589−---
3590−### `++sun:rd`
3591−
3592−Unsigned integer to `@rd`
3593−
3594−Converts an unsigned integer `a` to `@rd`.
3595−
3596−#### Accepts
3597−
3598−`a` is a `@u`, an unsigned integer.
3599−
3600−#### Produces
3601−
3602−A `@rd`.
3603−
3604−#### Source
3605−
3606−```hoon
3607− ++ sun |= [a=@u] ^- @rd (sun:ma a)
3608−```
3609−
3610−#### Examples
3611−
3612−```
3613− > (sun:rd 511)
3614− .~5.11e2
3615−```
3616−
3617−---
3618−### `++san:rd`
3619−
3620−Unsigned integer to `@rd`
3621−
3622−Converts a signed integer `a` to `@rd`.
3623−
3624−#### Accepts
3625−
3626−`a` is a `@s`, a signed integer.
3627−
3628−#### Produces
3629−
3630−A `@rd`.
3631−
3632−#### Source
3633−
3634−```hoon
3635− ++ san |= [a=@s] ^- @rd (san:ma a)
3636−```
3637−
3638−#### Examples
3639−
3640−```
3641− > (san:rd -511)
3642− .~-5.11e2
3643−```
3644−
3645−---
3646−### `++sig:rd`
3647−
3648−Get sign
3649−
3650−Produces the sign of `a`.
3651−
3652−#### Accepts
3653−
3654−`a` is a `@rd`
3655−
3656−#### Produces
3657−
3658−A `flag`.
3659−
3660−#### Source
3661−
3662−```hoon
3663− ++ sig |= [a=@rd] ^- ? (sig:ma a)
3664−```
3665−
3666−#### Examples
3667−
3668−```
3669− > (sig:rd .~1.2246e3)
3670− %.y
3671−```
3672−
3673−---
3674−### `++exp:rd`
3675−
3676−Get exponent
3677−
3678−Produces the exponent of `a`.
3679−
3680−#### Accepts
3681−
3682−`a` is a `@rd`
3683−
3684−#### Produces
3685−
3686−A `@s`.
3687−
3688−#### Source
3689−
3690−```hoon
3691− ++ exp |= [a=@rd] ^- @s (exp:ma a) :: get exponent
3692−```
3693−
3694−#### Examples
3695−
3696−```
3697− > (exp:rd .~1.2246e3)
3698− --10
3699−```
3700−
3701−---
3702−### `++toi:rd`
3703−
3704−Round to integer
3705−
3706−Rounds `a` to the nearest integer.
3707−
3708−#### Accepts
3709−
3710−`a` is a `@rd`
3711−
3712−#### Produces
3713−
3714−A `unit` of `@s`.
3715−
3716−#### Source
3717−
3718−```hoon
3719− ++ toi |= [a=@rd] ^- (unit @s) (toi:ma a)
3720−```
3721−
3722−#### Examples
3723−
3724−```
3725− > (toi:rd .~1.2246e3)
3726− [~ u=--1.224]
3727−```
3728−
3729−---
3730−### `++drg:rd`
3731−
3732−`@rd` to decimal float
3733−
3734−Produces the decimal form of `a` using the Dragon4 algorithm. Guarantees
3735−accurate results for rounded floats.
3736−
3737−#### Accepts
3738−
3739−`a` is a `@rd`
3740−
3741−#### Produces
3742−
3743−A `dn`.
3744−
3745−#### Source
3746−
3747−```hoon
3748− ++ drg |= [a=@rd] ^- dn (drg:ma a)
3749−```
3750−
3751−#### Examples
3752−
3753−```
3754− > (drg:rd .~1.2246e3)
3755− [%d s=%.y e=-1 a=12.246]
3756−```
3757−
3758−---
3759−### `++grd:rd`
3760−
3761−Decimal float to `@rd`
3762−
3763−Converts `a` from decimal float to `@rd`.
3764−
3765−#### Accepts
3766−
3767−`a` is a `@dn`
3768−
3769−#### Produces
3770−
3771−A `@rd`.
3772−
3773−#### Source
3774−
3775−```hoon
3776− ++ grd |= [a=dn] ^- @rd (grd:ma a) :: decimal float to @rd
3777− --
3778−```
3779−
3780−#### Examples
3781−
3782−```
3783− > (grd:rd [%d s=%.y e=-1 a=12.246])
3784− .~1.2246e3
3785−```
3786−
3787−---
3788−### `++rs`
3789−
3790−Single-precision fp
3791−
3792−A container core for operations related to single-precision binary floats.
3793−
3794−`++rs` has four rounding modes: round to nearest (`$n`), round up (`$u`), round
3795−down (`$d`), and round to zero (`$z`).
3796−
3797−#### Source
3798−
3799−```hoon
3800− ++ rs
3801− ~% %rs +> ~
3802− ^?
3803− |_ r=$?($n $u $d $z)
3804−```
3805−
3806−---
3807−### `++ma:rs`
3808−
3809−Initialize `ff`
3810−
3811−Instantiates the core `ff`, giving values to its samples based on the
3812−configuration of the `rs` core.
3813−
3814−#### Source
3815−
3816−```hoon
3817− ++ ma
3818− %*(. ff w 8, p 23, b --127, r r)
3819−```
3820−
3821−#### Examples
3822−
3823−```
3824− > ~(ma rs %n)
3825− < 24.ltg
3826− {{{w/@ud p/@ud b/@sd} r/?($n $u $d $z)} <54.tyv 119.wim 31.ohr 1.jmk $143>}
3827− >
3828−```
3829−
3830−---
3831−### `++sea:rs`
3832−
3833−`@rs` to `fn`
3834−
3835−Converts `a` from `@rs` to `fn`.
3836−
3837−#### Accepts
3838−
3839−`a` is a `@rs`, an single-precision float.
3840−
3841−#### Produces
3842−
3843−An `fn`.
3844−
3845−#### Source
3846−
3847−```hoon
3848− ++ sea
3849− |= [a=@rs] (sea:ma a)
3850−```
3851−
3852−#### Examples
3853−
3854−```
3855− > (sea:rs .1.4e-43)
3856− [%f s=%.y e=-149 a=100]
3857−```
3858−
3859−---
3860−### `++bit:rs`
3861−
3862−`fn` to `@rs`
3863−
3864−Converts `a` from `fn` to `@rs`.
3865−
3866−#### Accepts
3867−
3868−`a` is an `fn`.
3869−
3870−#### Produces
3871−
3872−A `@rs`, a single-precision float.
3873−
3874−#### Source
3875−
3876−```hoon
3877− ++ bit
3878− |= [a=fn] ^- @rs (bit:ma a)
3879−```
3880−
3881−#### Examples
3882−
3883−```
3884− > (bit:rs [%f & -2 1.000])
3885− .2.5e2
3886−```
3887−
3888−---
3889−### `++add:rs`
3890−
3891−Add
3892−
3893−Produces the sum of `a` plus `b`.
3894−
3895−#### Accepts
3896−
3897−`a` is a `@rs`, a single-precision float.
3898−
3899−`b` is a `@rs`.
3900−
3901−#### Produces
3902−
3903−A `@rs`.
3904−
3905−#### Source
3906−
3907−```hoon
3908− ++ add ~/ %add
3909− |= [a=@rs b=@rs] ^- @rs
3910− ~_ leaf+"rs-fail"
3911− (add:ma a b)
3912−```
3913−
3914−#### Examples
3915−
3916−```
3917− > (add:rs .2.5e1 .2.5e2)
3918− .2.75e2
3919−```
3920−
3921−---
3922−### `++sub:rs`
3923−
3924−Subtract
3925−
3926−Subtracts `a` from `b`.
3927−
3928−#### Source
3929−
3930−```hoon
3931− ++ sub ~/ %sub
3932− |= [a=@rs b=@rs] ^- @rs
3933− ~_ leaf+"rs-fail"
3934− (sub:ma a b)
3935−```
3936−
3937−#### Examples
3938−
3939−```
3940− > (sub:rs .2.5e1 .2.5e2)
3941− .-2.25e2
3942−```
3943−
3944−---
3945−### `++mul:rs`
3946−
3947−Multiply
3948−
3949−Produces the product of `a` multiplied by `b`.
3950−
3951−#### Accepts
3952−
3953−`a` is a `@rs`, a single-precision float.
3954−
3955−`b` is a `@rs`.
3956−
3957−#### Produces
3958−
3959−A `@rs`.
3960−
3961−#### Source
3962−
3963−```hoon
3964− ++ mul ~/ %mul
3965− |= [a=@rs b=@rs] ^- @rs
3966− ~_ leaf+"rs-fail"
3967− (mul:ma a b)
3968−```
3969−
3970−#### Examples
3971−
3972−```
3973− > (mul:rs .2.5e1 .2.5e2)
3974− .6.25e3
3975−```
3976−
3977−---
3978−### `++div:rs`
3979−
3980−Divide
3981−
3982−Produces the quotient of `a` divided by `b`.
3983−
3984−#### Accepts
3985−
3986−`a` is a `@rs`, a single-precision float.
3987−
3988−`b` is a `@rs`.
3989−
3990−#### Produces
3991−
3992−A `@rs`.
3993−
3994−#### Source
3995−
3996−```hoon
3997− ++ div ~/ %div
3998− |= [a=@rs b=@rs] ^- @rs
3999− ~_ leaf+"rs-fail"
4000− (div:ma a b)
4001−```
4002−
4003−#### Examples
4004−
4005−```
4006− > (div:rs .4.5e1 .2.2e2)
4007− .2.0454545e-1
4008−```
4009−
4010−---
4011−### `++fma:rs`
4012−
4013−Fused multiply-add
4014−
4015−Produces the sum of `c` plus the product of `a` multiplied by `b`;
4016−`(a * b) + c`.
4017−
4018−#### Accepts
4019−
4020−`a` is a `@rs`, a single-precision float.
4021−
4022−`b` is a `@rs`.
4023−
4024−`c` is a `@rs`.
4025−
4026−#### Produces
4027−
4028−A `@rs`.
4029−
4030−#### Source
4031−
4032−```hoon
4033− ++ fma ~/ %fma
4034− |= [a=@rs b=@rs c=@rs] ^- @rs
4035− ~_ leaf+"rs-fail"
4036− (fma:ma a b c)
4037−```
4038−
4039−#### Examples
4040−
4041−```
4042− > (fma:rs .2.5e1 .2.5e2 .8.2e1)
4043− .6.332e3
4044−```
4045−
4046−---
4047−### `++sqt:rs`
4048−
4049−Square root
4050−
4051−Produces the square root of `a`.
4052−
4053−#### Accepts
4054−
4055−`a` is a `@rs`, a single-precision float.
4056−
4057−#### Produces
4058−
4059−A `@rs`.
4060−
4061−#### Source
4062−
4063−```hoon
4064− ++ sqt ~/ %sqt
4065− |= [a=@rs] ^- @rs
4066− ~_ leaf+"rs-fail"
4067− (sqt:ma a)
4068−```
4069−
4070−#### Examples
4071−
4072−```
4073− > (sqt:rs .2.5e2)
4074− .1.5811388e1
4075−```
4076−
4077−---
4078−### `++lth:rs`
4079−
4080−Less than
4081−
4082−Test whether `a` is less than `b`.
4083−
4084−#### Accepts
4085−
4086−`a` is a `@rs`, a single-precision float.
4087−
4088−`b` is a `@rs`.
4089−
4090−#### Produces
4091−
4092−A `@rs`.
4093−
4094−#### Source
4095−
4096−```hoon
4097− ++ lth ~/ %lth
4098− |= [a=@rs b=@rs]
4099− ~_ leaf+"rs-fail"
4100− (lth:ma a b)
4101−```
4102−
4103−#### Examples
4104−
4105−```
4106− > (lth:rs .9.9e1 .1.1e2)
4107− %.y
4108−
4109− > (lth:rs .9.9e1 .9.9e1)
4110− %.n
4111−```
4112−
4113−---
4114−### `++lte:rs`
4115−
4116−Less than or equal
4117−
4118−Test whether `a` is less than or equal to `b`.
4119−
4120−#### Accepts
4121−
4122−`a` is a `@rs`, a single-precision float.
4123−
4124−`b` is a `@rs`.
4125−
4126−#### Produces
4127−
4128−A `@rs`.
4129−
4130−#### Source
4131−
4132−```hoon
4133− ++ lte ~/ %lte
4134− |= [a=@rs b=@rs]
4135− ~_ leaf+"rs-fail"
4136− (lte:ma a b)
4137−```
4138−
4139−#### Examples
4140−
4141−```
4142− > (lte:rs .9.9e1 .1.1e2)
4143− %.y
4144−
4145− > (lte:rs .9.9e1 .9.9e1)
4146− %.y
4147−```
4148−
4149−---
4150−### `++equ:rs`
4151−
4152−Equals
4153−
4154−Test whether `a` is equal to `b`.
4155−
4156−#### Accepts
4157−
4158−`a` is a `@rs`, a single-precision float.
4159−
4160−`b` is a `@rs`.
4161−
4162−#### Produces
4163−
4164−A `@rs`.
4165−
4166−#### Source
4167−
4168−```hoon
4169− ++ equ ~/ %equ
4170− |= [a=@rs b=@rs]
4171− ~_ leaf+"rs-fail"
4172− (equ:ma a b)
4173−```
4174−
4175−#### Examples
4176−
4177−```
4178− > (equ:rs .9.9e1 .1.1e2)
4179− %.n
4180−
4181− > (equ:rs .9.9e1 .9.9e1)
4182− %.y
4183−```
4184−
4185−---
4186−### `++gte:rs`
4187−
4188−Greater than or equal
4189−
4190−Test whether `a` is greater than or equal to `b`.
4191−
4192−#### Accepts
4193−
4194−`a` is a `@rs`, a single-precision float.
4195−
4196−`b` is a `@rs`.
4197−
4198−#### Produces
4199−
4200−A `@rs`.
4201−
4202−#### Source
4203−
4204−```hoon
4205− ++ gte ~/ %gte
4206− |= [a=@rs b=@rs]
4207− ~_ leaf+"rs-fail"
4208− (gte:ma a b)
4209−```
4210−
4211−#### Examples
4212−
4213−```
4214− > (gte:rs .9.9e1 .9.9e1)
4215− %.y
4216−
4217− > (gte:rs .9.9e1 .9.2e2)
4218− %.n
4219−```
4220−
4221−---
4222−### `++gth:rs`
4223−
4224−Greater than
4225−
4226−Test whether `a` is greater than `b`.
4227−
4228−#### Accepts
4229−
4230−`a` is a `@rs`, a single-precision float.
4231−
4232−`b` is a `@rs`.
4233−
4234−#### Produces
4235−
4236−A `@rs`.
4237−
4238−#### Source
4239−
4240−```hoon
4241− ++ gth ~/ %gth
4242− |= [a=@rs b=@rs]
4243− ~_ leaf+"rs-fail"
4244− (gth:ma a b)
4245−```
4246−
4247−#### Examples
4248−
4249−```
4250− > (gth:rs .9.9e1 .9.2e2)
4251− %.n
4252−
4253− > (gth:rs .9.9e1 .9.9e1)
4254− %.n
4255−
4256− > (gth:rs .9.9e1 .1.9e1)
4257− %.y
4258−```
4259−
4260−---
4261−### `++sun:rs`
4262−
4263−Unsigned integer to `@rs`
4264−
4265−Converts `a` from an unsigned integer to `@rs`.
4266−
4267−#### Accepts
4268−
4269−`a` is an unsigned integer.
4270−
4271−#### Produces
4272−
4273−A `@rs`.
4274−
4275−#### Source
4276−
4277−```hoon
4278− ++ sun |= [a=@u] ^- @rs (sun:ma a)
4279−```
4280−
4281−#### Examples
4282−
4283−```
4284− > (sun:rs 343)
4285− .3.43e2
4286−```
4287−
4288−---
4289−### `++san:rs`
4290−
4291−Signed integer to `@rs`'
4292−
4293−Converts `a` from an unsigned integer to `@rs`.
4294−
4295−#### Accepts
4296−
4297−`a` is a signed integer.
4298−
4299−#### Produces
4300−
4301−A `@rs`.
4302−
4303−#### Source
4304−
4305−```hoon
4306− ++ san |= [a=@s] ^- @rs (san:ma a)
4307−```
4308−
4309−#### Examples
4310−
4311−```
4312− > (san:rs -343)
4313− .-3.43e2'
4314−```
4315−
4316−### `++sig:rs`
4317−
4318−Get sign
4319−
4320−Produces the sign of `a`.
4321−
4322−#### Accepts
4323−
4324−`a` is a `@rs`.
4325−
4326−#### Produces
4327−
4328−A `flag`.
4329−
4330−#### Source
4331−
4332−```hoon
4333− ++ sig |= [a=@rs] ^- ? (sig:ma a)
4334−```
4335−
4336−#### Examples
4337−
4338−```
4339− > (sig:rs .3.43e2)
4340− %.y
4341−
4342− > (sig:rs .-3.43e2)
4343− %.n
4344−```
4345−
4346−---
4347−### `++exp:rs`
4348−
4349−Get exponent
4350−
4351−Produces the exponent of `a`.
4352−
4353−#### Accepts
4354−
4355−`a` is a `@rs`.
4356−
4357−#### Produces
4358−
4359−A signed integer.
4360−
4361−#### Source
4362−
4363−```hoon
4364− ++ exp |= [a=@rs] ^- @s (exp:ma a)
4365−```
4366−
4367−#### Examples
4368−
4369−```
4370− > (exp:rs .-3.43e2)
4371− --8
4372−```
4373−
4374−---
4375−### `++toi:rs`
4376−
4377−Round to integer
4378−
4379−Rounds `a` to the nearest integer.
4380−
4381−#### Accepts
4382−
4383−`a` is a `@rs`.
4384−
4385−#### Produces
4386−
4387−A `unit` of `@s`.
4388−
4389−#### Source
4390−
4391−```hoon
4392− ++ toi |= [a=@rs] ^- (unit @s) (toi:ma a)
4393−```
4394−
4395−#### Examples
4396−
4397−```
4398− > (toi:rs .-3.43e2)
4399− [~ u=-343]
4400−```
4401−
4402−---
4403−### `++drg:rs`
4404−
4405−`@rs` to decimal float
4406−
4407−Produces the decimal form of `a` using the Dragon4 algorithm. Guarantees
4408−accurate results for rounded floats.
4409−
4410−#### Accepts
4411−
4412−`a` is a `@rs`
4413−
4414−#### Produces
4415−
4416−A `dn`.
4417−
4418−#### Source
4419−
4420−```hoon
4421− ++ drg |= [a=@rs] ^- dn (drg:ma a)
4422−```
4423−
4424−#### Examples
4425−
4426−```
4427− > (drg:rs .-3.43e2)
4428− [%d s=%.n e=--0 a=343]
4429−```
4430−
4431−---
4432−### `++grd:rs`
4433−
4434−Decimal float to `@rs`
4435−
4436−Converts `a` from `dn` to `@rs`.
4437−
4438−#### Accepts
4439−
4440−`a` is a `dn`.
4441−
4442−#### Produces
4443−
4444−A `@rs`.
4445−
4446−#### Source
4447−
4448−```hoon
4449− ++ grd |= [a=dn] ^- @rs (grd:ma a)
4450− --
4451−```
4452−
4453−#### Examples
4454−
4455−```
4456− > (grd:rs [%d s=%.n e=--0 a=343])
4457− .-3.43e2
4458−```
4459−
4460−---
4461−### `++rq`
4462−
4463−Quadruple-precision fp
4464−
4465−A container core for operations related to quadruple-precision binary floats.
4466−
4467−`++rq` has four rounding modes: round to nearest (`$n`), round up (`$u`), round
4468−down (`$d`), and round to zero (`$z`).
4469−
4470−#### Source
4471−
4472−```hoon
4473− ++ rq
4474− ~% %rq +> ~
4475− ^?
4476− |_ r=$?($n $u $d $z)
4477−```
4478−
4479−### `++ma:rq`
4480−
4481−Initialize `ff`
4482−
4483−Instantiates the core `ff`, giving values to its samples based on the
4484−configuration of the `rq` core.
4485−
4486−#### Source
4487−
4488−```hoon
4489− ++ ma
4490− %*(. ff w 15, p 112, b --16.383, r r)
4491−```
4492−
4493−---
4494−### `++sea:rq`
4495−
4496−`@rq` to `fn`
4497−
4498−Converts `a` from `@rq` to `fn`.
4499−
4500−#### Accepts
4501−
4502−`a` is a `@rq`, a quad-precision float.
4503−
4504−#### Produces
4505−
4506−An `fn`.
4507−
4508−#### Source
4509−
4510−```hoon
4511− ++ sea
4512− |= [a=@rq] (sea:ma a)
4513−```
4514−
4515−#### Examples
4516−
4517−```
4518− > (sea:rq .~~~1.05102e5)
4519− [%f s=%.y e=-96 a=8.327.038.336.574.210.409.756.656.268.214.272]
4520−```
4521−
4522−---
4523−### `++bit:rq`
4524−
4525−`fn` to `@rq`
4526−
4527−Converts `a` from `fn` to `@rq`.
4528−
4529−#### Accepts
4530−
4531−`a` is an `fn`.
4532−
4533−#### Produces
4534−
4535−A `@rq`, a quad-precision float.
4536−
4537−#### Source
4538−
4539−```hoon
4540− ++ bit
4541− |= [a=n] ^- @rq (bit:ma a)
4542−```
4543−
4544−#### Examples
4545−
4546−```
4547− > (bit:rq [%f s=%.y e=-96 a=8.327.038.336.574.210.409.756.656.268.214.272])
4548− .~~~1.05102e5
4549−```
4550−
4551−---
4552−### `++add:rq`
4553−
4554−Add
4555−
4556−Produces the sum of `a` plus `b`.
4557−
4558−#### Accepts
4559−
4560−`a` is a `@rq`, a quad-precision float.
4561−
4562−`b` is a `@rq`.
4563−
4564−#### Produces
4565−
4566−A `@rq`.
4567−
4568−#### Source
4569−
4570−```hoon
4571− ++ add ~/ %add
4572− |= [a=@rq b=@rq] ^- @rq
4573− ~_ leaf+"rq-fail"
4574− (add:ma a b)
4575−```
4576−
4577−#### Examples
4578−
4579−```
4580− > (add:rq .~~~-1.821e5 .~~~1.05102e5)
4581− .~~~-7.6998e4
4582−```
4583−
4584−---
4585−### `++sub:rq`
4586−
4587−Subtract
4588−
4589−Produces the difference of `a` minus `b`.
4590−
4591−#### Accepts
4592−
4593−`a` is a `@rq`, a quad-precision float.
4594−
4595−`b` is a `@rq`.
4596−
4597−#### Produces
4598−
4599−A `@rq`.
4600−
4601−#### Source
4602−
4603−```hoon
4604− ++ sub ~/ %sub
4605− |= [a=@rq b=@rq] ^- @rq
4606− ~_ leaf+"rq-fail"
4607− (sub:ma a b)
4608−```
4609−
4610−#### Examples
4611−
4612−```
4613− > (sub:rq .~~~1.821e5 .~~~1.05102e5)
4614− .~~~7.6998e4
4615−
4616− > (sub:rq .~~~1.821e5 .~~~-1.05102e5)
4617− .~~~2.87202e5
4618−```
4619−
4620−---
4621−### `++mul:rq`
4622−
4623−Multiply
4624−
4625−Produces the product of `a` times `b`.
4626−
4627−#### Accepts
4628−
4629−`a` is a `@rq`, a quad-precision float.
4630−
4631−`b` is a `@rq`.
4632−
4633−#### Produces
4634−
4635−A `@rq`.
4636−
4637−#### Source
4638−
4639−```hoon
4640− ++ mul ~/ %mul
4641− |= [a=@rq b=@rq] ^- @rq
4642− ~_ leaf+"rq-fail"
4643− (mul:ma a b)
4644−```
4645−
4646−#### Examples
4647−
4648−```
4649− > (mul:rq .~~~1.821e5 .~~~-1.05102e5)
4650− .~~~-1.91390742e10
4651−```
4652−
4653−---
4654−### `++div:rq`
4655−
4656−Divide
4657−
4658−Produces the product of `a` divided by `b`.
4659−
4660−#### Accepts
4661−
4662−`a` is a `@rq`, a quad-precision float.
4663−
4664−`b` is a `@rq`.
4665−
4666−#### Produces
4667−
4668−A `@rq`.
4669−
4670−#### Source
4671−
4672−```hoon
4673− ++ div ~/ %div
4674− |= [a=@rq b=@rq] ^- @rq
4675− ~_ leaf+"rq-fail"
4676− (div:ma a b)
4677−```
4678−
4679−#### Examples
4680−
4681−```
4682− > (div:rq .~~~1.821e5 .~~~1.05102e3)
4683− .~~~1.732602614602957127361991208540275e2
4684−```
4685−
4686−---
4687−### `++fma:rq`
4688−
4689−Fused multiply-add
4690−
4691−Produces the sum of `c` plus the product of `a` multiplied by `b`;
4692−`(a * b) + c`.
4693−
4694−#### Accepts
4695−
4696−`a` is a `@rq`, a quad-precision float.
4697−
4698−`b` is a `@rq`.
4699−
4700−`c` is a `@rq`.
4701−
4702−#### Produces
4703−
4704−A `@rq`.
4705−
4706−#### Source
4707−
4708−```hoon
4709− ++ fma ~/ %fma
4710− |= [a=@rq b=@rq c=@rq] ^- @rq
4711− ~_ leaf+"rq-fail"
4712− (fma:ma a b c)
4713−```
4714−
4715−#### Examples
4716−
4717−```
4718− > (fma:rq .~~~1.821e5 .~~~-1.05102e2 .~~~6.2044e7)
4719− .~~~4.29049258e7
4720−```
4721−
4722−---
4723−### `++sqt:rq`
4724−
4725−Square root
4726−
4727−Produces the square root of `a`.
4728−
4729−#### Accepts
4730−
4731−`a` is a `@rq`, a quad-precision float.
4732−
4733−#### Produces
4734−
4735−A `@rq`.
4736−
4737−#### Source
4738−
4739−```hoon
4740− ++ sqt ~/ %sqt
4741− |= [a=@rq] ^- @rq
4742− ~_ leaf+"rq-fail"
4743− (sqt:ma a)
4744−```
4745−
4746−#### Examples
4747−
4748−```
4749− > (sqt:rq .~~~6.2044e7)
4750− .~~~7.876801381271461258959876570289002e3
4751−```
4752−
4753−---
4754−### `++lth:rq`
4755−
4756−Less than
4757−
4758−Tests whether `a` is less than `b`.
4759−
4760−#### Accepts
4761−
4762−`a` is a `@rq`, a quad-precision float.
4763−
4764−`b` is a `@rq`.
4765−
4766−#### Produces
4767−
4768−A `@rq`.
4769−
4770−#### Source
4771−
4772−```hoon
4773− ++ lth ~/ %lth
4774− |= [a=@rq b=@rq]
4775− ~_ leaf+"rq-fail"
4776− (lth:ma a b)
4777−```
4778−
4779−
4780−#### Examples
4781−
4782−```
4783− > (lth:rq .~~~1.2044e7 (mul:rq .~~~9.02e2 .~~~7.114e3))
4784− %.n
4785−
4786− > (lth:rq .~~~1.2044e7 (mul:rq .~~~9.02e3 .~~~7.114e3))
4787− %.y
4788−```
4789−
4790−---
4791−### `++lte:rq`
4792−
4793−Less than or equal
4794−
4795−Tests whether `a` is less than or equal to `b`.
4796−
4797−#### Accepts
4798−
4799−`a` is a `@rq`, a quad-precision float.
4800−
4801−`b` is a `@rq`.
4802−
4803−#### Produces
4804−
4805−A `@rq`.
4806−
4807−#### Source
4808−
4809−```hoon
4810− ++ lte ~/ %lte
4811− |= [a=@rq b=@rq]
4812− ~_ leaf+"rq-fail"
4813− (lte:ma a b)
4814−```
4815−
4816−#### Examples
4817−
4818−```
4819− > (lte:rq .~~~1.2044e7 (mul:rq .~~~9.02e2 .~~~7.114e3))
4820− %.n
4821−
4822− > (lte:rq .~~~1.2044e7 (mul:rq .~~~9.02e3 .~~~7.114e3))
4823− %.y
4824−
4825− > (lte:rq .~~~1.2044e7 .~~~1.2044e7)
4826− %.y
4827−```
4828−
4829−---
4830−### `++equ:rq`
4831−
4832−Equals
4833−
4834−Tests whether `a` is equal to `b`.
4835−
4836−#### Accepts
4837−
4838−`a` is a `@rq`, a quad-precision float.
4839−
4840−`b` is a `@rq`.
4841−
4842−#### Produces
4843−
4844−A `@rq`.
4845−
4846−#### Source
4847−
4848−```hoon
4849− ++ equ ~/ %equ
4850− |= [a=@rq b=@rq]
4851− ~_ leaf+"rq-fail"
4852− (equ:ma a b)
4853−```
4854−
4855−#### Examples
4856−
4857−```
4858− > (equ:rq .~~~1.2044e7 .~~~1.2044e7)
4859− %.y
4860−
4861− > (equ:rq .~~~2.2044e7 .~~~1.2044e7)
4862− %.n
4863−```
4864−
4865−---
4866−### `++gte:rq`
4867−
4868−Greater than or equal
4869−
4870−Tests whether `a` is greater than or equal to `b`.
4871−
4872−#### Accepts
4873−
4874−`a` is a `@rq`, a quad-precision float.
4875−
4876−`b` is a `@rq`.
4877−
4878−#### Produces
4879−
4880−A `@rq`.
4881−
4882−#### Source
4883−
4884−```hoon
4885− ++ gte ~/ %gte
4886− |= [a=@rq b=@rq]
4887− ~_ leaf+"rq-fail"
4888− (gte:ma a b)
4889−```
4890−
4891−#### Examples
4892−
4893−```
4894− > (gte:rq .~~~1.2044e7 .~~~1.2044e7)
4895− %.y
4896−
4897− > (gte:rq .~~~2.2044e7 .~~~1.2044e7)
4898− %.y
4899−
4900− > (gte:rq .~~~1.2044e7 .~~~2.2044e7)
4901− %.n
4902−```
4903−
4904−---
4905−### `++gth:rq`
4906−
4907−Tests whether `a` is greater than `b`.
4908−
4909−#### Accepts
4910−
4911−`a` is a `@rq`, a quad-precision float.
4912−
4913−`b` is a `@rq`.
4914−
4915−#### Produces
4916−
4917−A `@rq`.
4918−
4919−#### Source
4920−
4921−```hoon
4922− ++ gth ~/ %gth
4923− |= [a=@rq b=@rq]
4924− ~_ leaf+"rq-fail"
4925− (gth:ma a b)
4926−```
4927−
4928−#### Examples
4929−
4930−```
4931− > (gth:rq .~~~1.2044e7 .~~~1.2044e7)
4932− %.n
4933−
4934− > (gth:rq .~~~2.2044e7 .~~~1.2044e7)
4935− %.y
4936−
4937− > (gth:rq .~~~1.2044e7 .~~~2.2044e7)
4938− %.n
4939−```
4940−
4941−---
4942−### `++sun:rq`
4943−
4944−Unsigned integer to `@rq`
4945−
4946−Converts `@` from an unsigned integer to `@rq`.
4947−
4948−#### Accepts
4949−
4950−`a` is a `@u`, an unsigned integer.
4951−
4952−#### Produces
4953−
4954−A `@rq`, a quad-precision float.
4955−
4956−#### Source
4957−
4958−```hoon
4959− ++ sun |= [a=@u] ^- @rq (sun:ma a)
4960−```
4961−
4962−#### Examples
4963−
4964−```
4965− > (sun:rq 205)
4966− .~~~2.05e2
4967−```
4968−
4969−---
4970−### `++san:rq`
4971−
4972−Signed integer to `rq`
4973−
4974−Converts `@` from a signed integer to `@rq`.
4975−
4976−#### Accepts
4977−
4978−`a` is a `@s`, a signed integer.
4979−
4980−#### Produces
4981−
4982−A `@rq`, a quad-precision float.
4983−
4984−#### Source
4985−
4986−```hoon
4987− ++ san |= [a=@s] ^- @rq (san:ma a)
4988−```
4989−
4990−#### Examples
4991−
4992−```
4993− > (san:rq -205)
4994− .~~~-2.05e2
4995−```
4996−
4997−---
4998−### `++sig:rq`
4999−
5000−Get sign
5001−
5002−Produces the sign of `a`.
5003−
5004−#### Accepts
5005−
5006−`a` is a `@rq`, a quad-precision float.
5007−
5008−#### Produces
5009−
5010−A `flag`.
5011−
5012−#### Source
5013−
5014−```hoon
5015− ++ sig |= [a=@rq] ^- ? (sig:ma a)
5016−```
5017−
5018−#### Examples
5019−
5020−```
5021− > (sig:rq .~~~-2.05e2)
5022− %.n
5023−```
5024−
5025−---
5026−### `++exp:rq`
5027−
5028−Get exponent
5029−
5030−Gets the exponent of `a`.
5031−
5032−#### Accepts
5033−
5034−`a` is a `@rq`, a quad-precision float.
5035−
5036−#### Produces
5037−
5038−A `@s`, a signed integer.
5039−
5040−#### Source
5041−
5042−```hoon
5043− ++ exp |= [a=@rq] ^- @s (exp:ma a)
5044−```
5045−
5046−#### Examples
5047−
5048−```
5049− > (exp:rq .~~~-2.05e2)
5050− --7
5051−```
5052−
5053−---
5054−### `++toi:rq`
5055−
5056−Round to integer
5057−
5058−Rounds `a` to the nearest integer.
5059−
5060−#### Accepts
5061−
5062−`a` is a `@rq`, a quad-precision float.
5063−
5064−#### Produces
5065−
5066−A `unit` of `@s`.
5067−
5068−#### Source
5069−
5070−```hoon
5071− ++ toi |= [a=@rq] ^- (unit @s) (toi:ma a)
5072−```
5073−
5074−#### Examples
5075−
5076−```
5077− > (toi:rq .~~~-2.085e2)
5078− [~ u=-208]
5079−
5080− > (toi:rq .~~~-2.08e2)
5081− [~ u=-208]
5082−```
5083−
5084−---
5085−### `++drg:rq`
5086−
5087−`@rq` to decimal float
5088−
5089−Produces the decimal form of `a` using the Dragon4 algorithm. Guarantees
5090−accurate results for rounded floats.
5091−
5092−#### Accepts
5093−
5094−`a` is a `@rq`, a quad-precision float.
5095−
5096−#### Produces
5097−
5098−A `dn`.
5099−
5100−#### Source
5101−
5102−```hoon
5103− ++ drg |= [a=@rq] ^- dn (drg:ma a) :: @rq to decimal float
5104−```
5105−
5106−#### Examples
5107−
5108−```
5109− > (drg:rq .~~~-2.085e2)
5110− [%d s=%.n e=-1 a=2.085]
5111−
5112− > (drg:rq .~~~-2.08e2)
5113− [%d s=%.n e=--0 a=208]
5114−```
5115−
5116−---
5117−### `++grd:rq`
5118−
5119−Decimal float to `@rq`
5120−
5121−Converts `a` from `dn` to `@rq`.
5122−
5123−#### Accepts
5124−
5125−`a` is `dn`.
5126−
5127−`a` is a `@rq`.
5128−
5129−#### Produces
5130−
5131−A `@rq`, a quad-precision float.
5132−
5133−#### Source
5134−
5135−```hoon
5136− ++ grd |= [a=dn] ^- @rq (grd:ma a)
5137− --
5138−```
5139−
5140−#### Examples
5141−
5142−```
5143− > (grd:rq [%d s=%.n e=--0 a=343])
5144− .~~~-3.43e2
5145−```
5146−
5147−---
5148−### `++rh`
5149−
5150−Half-precision fp
5151−
5152−A container core for operations related to half-precision binary floats.
5153−
5154−`++rh` has four rounding modes: round to nearest (`$n`), round up (`$u`), round
5155−down (`$d`), and round to zero (`$z`).
5156−
5157−#### Source
5158−
5159−```hoon
5160− ++ rh
5161− ~% %rh +> ~
5162− ^?
5163− |_ r=$?($n $u $d $z)
5164−```
5165−
5166−---
5167−### `++ma:rh`
5168−
5169−Initialize `ff`
5170−
5171−Instantiates the core `ff`, giving values to its samples based on the
5172−configuration of the `rh` core.
5173−
5174−#### Source
5175−
5176−```hoon
5177− ++ ma
5178− %*(. ff w 5, p 10, b --15, r r)
5179−```
5180−
5181−---
5182−### `++sea:rh`
5183−
5184−`@rh` to `fn`
5185−
5186−Converts `a` from `@rh` to `fn`.
5187−
5188−#### Accepts
5189−
5190−`a` is a `@rh`, a half-precision float.
5191−
5192−#### Produces
5193−
5194−An `fn`.
5195−
5196−#### Source
5197−
5198−```hoon
5199− ++ sea
5200− |= [a=@rh] (sea:ma a)
5201−```
5202−
5203−#### Examples
5204−
5205−```
5206− > (sea:rh .~~1.22e-5)
5207− [%f s=%.y e=-24 a=205]
5208−```
5209−
5210−---
5211−### `++bit:rh`
5212−
5213−`fn` to `@rh`
5214−
5215−Converts `a` from `fn` to `@rh`.
5216−
5217−#### Accepts
5218−
5219−`a` is an `fn`.
5220−
5221−#### Produces
5222−
5223−A `@rh`, a half-precision float.
5224−
5225−#### Source
5226−
5227−```hoon
5228− ++ bit
5229− |= [a=fn] ^- @rh (bit:ma a)
5230−```
5231−
5232−#### Examples
5233−
5234−```
5235− > (bit:rh [%f s=%.y e=-24 a=205])
5236− .~~1.22e-5
5237−```
5238−
5239−---
5240−### `++add:rh`
5241−
5242−Produces the sum of `a` plus `b`.
5243−
5244−#### Accepts
5245−
5246−`a` is a `@rh`, a half-precision float.
5247−
5248−`b` is a `@rh`.
5249−
5250−#### Produces
5251−
5252−A `@rh`.
5253−
5254−#### Source
5255−
5256−```hoon
5257− ++ add ~/ %add
5258− |= [a=@rh b=@rh] ^- @rh
5259− ~_ leaf+"rh-fail"
5260− (add:ma a b)
5261−```
5262−
5263−#### Examples
5264−
5265−```
5266− > (add:rh .~~1.82e2 .~~1.02e2)
5267− .~~2.84e2
5268−```
5269−
5270−---
5271−### `++sub:rh`
5272−
5273−Subtract
5274−
5275−Produces the difference of `a` minus `b`.
5276−
5277−#### Accepts
5278−
5279−`a` is a `@rh`, a half-precision float.
5280−
5281−`b` is a `@rh`.
5282−
5283−#### Produces
5284−
5285−A `@rh`.
5286−
5287−#### Source
5288−
5289−```hoon
5290− ++ sub ~/ %sub
5291− |= [a=@rh b=@rh] ^- @rh
5292− ~_ leaf+"rh-fail"
5293− (sub:ma a b)
5294−```
5295−
5296−#### Examples
5297−
5298−```
5299− > (sub:rh .~~1.821e2 .~~1.051e2)
5300− .~~7.7e1
5301−
5302− > (sub:rh .~~1.821e2 .~~6.051e2)
5303− .~~-4.228e2
5304−```
5305−
5306−---
5307−### `++mul:rh`
5308−
5309−Multiply
5310−
5311−Produces the product of `a` times `b`.
5312−
5313−#### Accepts
5314−
5315−`a` is a `@rh`, a quad-precision float.
5316−
5317−`b` is a `@rh`.
5318−
5319−#### Produces
5320−
5321−A `@rh`.
5322−
5323−#### Source
5324−
5325−```hoon
5326− ++ mul ~/ %mul
5327− |= [a=@rh b=@rh] ^- @rh
5328− ~_ leaf+"rh-fail"
5329− (mul:ma a b)
5330−```
5331−
5332−#### Examples
5333−
5334−```
5335− > (mul:rh .~~1.821e1 .~~-1.05102e2)
5336− .~~-1.913e3
5337−```
5338−
5339−---
5340−### `++div:rh`
5341−
5342−Divide
5343−
5344−Produces the product of `a` divided by `b`.
5345−
5346−#### Accepts
5347−
5348−`a` is a `@rh`, a half-precision float.
5349−
5350−`b` is a `@rh`.
5351−
5352−#### Produces
5353−
5354−A `@rh`.
5355−
5356−#### Source
5357−
5358−```hoon
5359− ++ div ~/ %div
5360− |= [a=@rh b=@rh] ^- @rh
5361− ~_ leaf+"rh-fail"
5362− (div:ma a b)
5363−```
5364−
5365−#### examples
5366−
5367−```
5368− > (div:rh .~~1.821e3 .~~1.05102e2)
5369− .~~1.731e1
5370−```
5371−
5372−---
5373−### `++fma:rh`
5374−
5375−Fused multiply-add
5376−
5377−Produces the sum of `c` plus the product of `a` multiplied by `b`;
5378−`(a * b) + c`.
5379−
5380−#### Accepts
5381−
5382−`a` is a `@rh`, a half-precision float.
5383−
5384−`b` is a `@rh`.
5385−
5386−`c` is a `@rh`.
5387−
5388−#### Produces
5389−
5390−A `@rh`.
5391−
5392−#### Source
5393−
5394−```hoon
5395− ++ fma ~/ %fma
5396− |= [a=@rh b=@rh c=@rh] ^- @rh
5397− ~_ leaf+"rh-fail"
5398− (fma:ma a b c)
5399−```
5400−
5401−#### Examples
5402−
5403−```
5404− > (fma:rh .~~1.821e4 .~~-1.05102e2 .~~6.2044e3)
5405− .~~-6.55e4
5406−```
5407−
5408−---
5409−### `++sqt:rh`
5410−
5411−Square root
5412−
5413−Produces the square root of `a`.
5414−
5415−#### Accepts
5416−
5417−`a` is a `@rh`, a half-precision float.
5418−
5419−#### Produces
5420−
5421−A `@rh`.
5422−
5423−#### Source
5424−
5425−```hoon
5426− ++ sqt ~/ %sqt
5427− |= [a=@rh] ^- @rh
5428− ~_ leaf+"rh-fail"
5429− (sqt:ma a)
5430−```
5431−
5432−#### Source
5433−
5434−```hoon
5435− > (sqt:rh .~~6.24e4)
5436− .~~2.498e2
5437−```
5438−
5439−---
5440−### `++lth:rh`
5441−
5442−Less than
5443−
5444−Tests whether `a` is less than `b`.
5445−
5446−#### Accepts
5447−
5448−`a` is a `@rh`, a half-precision float.
5449−
5450−`b` is a `@rh`.
5451−
5452−#### Produces
5453−
5454−A `@rh`.
5455−
5456−#### Source
5457−
5458−```hoon
5459− ++ lth ~/ %lth
5460− |= [a=@rh b=@rh]
5461− ~_ leaf+"rh-fail"
5462− (lth:ma a b)
5463−```
5464−
5465−#### Examples
5466−
5467−```
5468− > (lth:rh .~~1.2e5 (mul:rh .~~9.02e2 .~~7.114e2))
5469− %.n
5470−
5471− > (lth:rh .~~1.2e3 (mul:rh .~~9.02e1 .~~7.114e2))
5472− %.y
5473−```
5474−
5475−---
5476−### `++lte:rh`
5477−
5478−Less than or equal
5479−
5480−Tests whether `a` is less than or equal to `b`.
5481−
5482−#### Accepts
5483−
5484−`a` is a `@rh`, a half-precision float.
5485−
5486−`b` is a `@rh`.
5487−
5488−#### Produces
5489−
5490−A `@rh`.
5491−
5492−#### Source
5493−
5494−```hoon
5495− ++ lte ~/ %lte
5496− |= [a=@rh b=@rh]
5497− ~_ leaf+"rh-fail"
5498− (lte:ma a b)
5499−```
5500−
5501−#### Examples
5502−
5503−```
5504− > (lte:rh .~~1.2e5 (mul:rh .~~9.02e2 .~~7.114e2))
5505− %.n
5506−
5507− > (lte:rh .~~1.2e3 (mul:rh .~~9.02e1 .~~7.114e2))
5508− %.y
5509−
5510− > (lte:rh .~~1.2e3 .~~1.2e3)
5511− %.y
5512−```
5513−
5514−---
5515−### `++equ:rh`
5516−
5517−Equals
5518−
5519−Tests whether `a` is equal to `b`.
5520−
5521−#### Accepts
5522−
5523−`a` is a `@rh`, a half-precision float.
5524−
5525−`b` is a `@rh`.
5526−
5527−#### Produces
5528−
5529−A `@rh`.
5530−
5531−#### Source
5532−
5533−```hoon
5534− ++ equ ~/ %equ
5535− |= [a=@rh b=@rh]
5536− ~_ leaf+"rh-fail"
5537− (equ:ma a b)
5538−```
5539−
5540−#### Examples
5541−
5542−```
5543− > (equ:rh .~~1.24e4 .~~1.24e4)
5544− %.y
5545−
5546− > (equ:rh .~~2.24e4 .~~1.24e4)
5547− %.n
5548−```
5549−
5550−---
5551−### `++gte:rh`
5552−
5553−Greater than or equal
5554−
5555−Tests whether `a` is greater than or equal to `b`.
5556−
5557−#### Accepts
5558−
5559−`a` is a `@rh`, a half-precision float.
5560−
5561−`b` is a `@rh`.
5562−
5563−#### Produces
5564−
5565−A `@rh`.
5566−
5567−#### Source
5568−
5569−```hoon
5570− ++ gte ~/ %gte
5571− |= [a=@rh b=@rh]
5572− ~_ leaf+"rh-fail"
5573− (gte:ma a b)
5574−```
5575−
5576−#### Examples
5577−
5578−```
5579− > (gte:rh .~~1.24e4 .~~1.24e4)
5580− %.y
5581−
5582− > (gte:rh .~~2.24e4 .~~1.24e4)
5583− %.y
5584−
5585− > (gte:rh .~~1.24e4 .~~2.24e4)
5586− %.n
5587−```
5588−
5589−---
5590−### `++gth:rh`
5591−
5592−Tests whether `a` is greater than `b`.
5593−
5594−#### Accepts
5595−
5596−`a` is a `@rh`, a half-precision float.
5597−
5598−`b` is a `@rh`.
5599−
5600−#### Produces
5601−
5602−A `@rh`.
5603−
5604−#### Source
5605−
5606−```hoon
5607− ++ gth ~/ %gth
5608− |= [a=@rh b=@rh]
5609− ~_ leaf+"rh-fail"
5610− (gth:ma a b)
5611−```
5612−
5613−#### Examples
5614−
5615−```
5616− > (gth:rh .~~1.24e4 .~~1.244e4)
5617− %.n
5618−
5619− > (gth:rh .~~2.24e4 .~~1.24e4)
5620− %.y
5621−
5622− > (gth:rh .~~1.24e4 .~~2.24e4)
5623− %.n
5624−```
5625−
5626−---
5627−
5628−### `++tos:rh`
5629−
5630−`@rh` to `@rs`
5631−
5632−Converts `@` from `@rh` to `@rs`.
5633−
5634−#### Accepts
5635−
5636−`a` is a `@rh`, a half-precision float.
5637−
5638−#### Produces
5639−
5640−A `@rs`, a single-precision float.
5641−
5642−#### Source
5643−
5644−```hoon
5645− ++ tos |= {a/@rh} (bit:rs (sea a))
5646−```
5647−
5648−#### Examples
5649−
5650−```
5651− > (tos:rh .~~2.5e2)
5652− .2.5e2
5653−```
5654−
5655−---
5656−### `++fos:rh`
5657−
5658−`@rs` to `@rh`
5659−
5660−Converts `@` from `@rs` to `@rh`.
5661−
5662−#### Accepts
5663−
5664−`a` is a `@rs`, a single-precision float.
5665−
5666−#### Produces
5667−
5668−A `@rh`, a half-precision float.
5669−
5670−#### Source
5671−
5672−```hoon
5673− ++ fos |= {a/@rs} (bit (sea:rs a))
5674−```
5675−
5676−#### Examples
5677−
5678−```
5679− > (fos:rh .2.5e2)
5680− .~~2.5e2
5681−```
5682−
5683−---
5684−### `++sun:rh`
5685−
5686−Unsigned integer to `@rh`
5687−
5688−Converts `@` from an unsigned integer to `@rh`.
5689−
5690−#### Accepts
5691−
5692−`a` is a `@u`, an unsigned integer.
5693−
5694−#### Produces
5695−
5696−A `@rh`, a half-precision float.
5697−
5698−#### Source
5699−
5700−```hoon
5701− ++ sun |= [a=@u] ^- @rh (sun:ma a)
5702−```
5703−
5704−#### Examples
5705−
5706−```
5707− > (sun:rh 205)
5708− .~~2.05e2
5709−```
5710−
5711−---
5712−### `++san:rh`
5713−
5714−Signed integer to `@rh`
5715−
5716−Converts `@` from a signed integer to `@rh`.
5717−
5718−#### Accepts
5719−
5720−`a` is a `@s`, a signed integer.
5721−
5722−#### Produces
5723−
5724−A `@rh`, a half-precision float.
5725−
5726−#### Source
5727−
5728−```hoon
5729− ++ san |= [a=@s] ^- @rh (san:ma a)
5730−```
5731−
5732−#### Examples
5733−
5734−```
5735− > (san:rh -205)
5736− .~~-2.05e2
5737−```
5738−
5739−---
5740−### `++sig:rh`
5741−
5742−Get sign
5743−
5744−Produces the sign of `a`.
5745−
5746−#### Accepts
5747−
5748−`a` is a `@rh`, a half-precision float.
5749−
5750−#### Produces
5751−
5752−A `flag`.
5753−
5754−#### Source
5755−
5756−```hoon
5757− ++ sig |= [a=@rh] ^- ? (sig:ma a)
5758−```
5759−
5760−#### Examples
5761−
5762−```
5763− > (sig:rh .~~-2.05e2)
5764− %.n
5765−```
5766−
5767−---
5768−### `++exp:rh`
5769−
5770−Get exponent
5771−
5772−Gets the exponent of `a`.
5773−
5774−#### Accepts
5775−
5776−`a` is a `@rh`, a half-precision float.
5777−
5778−#### Produces
5779−
5780−A `@s`, a signed integer.
5781−
5782−#### Source
5783−
5784−```hoon
5785− ++ exp |= [a=@rh] ^- @s (exp:ma a)
5786−```
5787−
5788−#### Examples
5789−
5790−```
5791− > (exp:rh .~~-2.05e2)
5792− --7
5793−```
5794−
5795−---
5796−### `++toi:rh`
5797−
5798−Round to integer
5799−
5800−Rounds `a` to the nearest integer.
5801−
5802−#### Accepts
5803−
5804−`a` is a `@rh`, a half-precision float.
5805−
5806−#### Produces
5807−
5808−A `unit` of `@s`.
5809−
5810−#### Source
5811−
5812−```hoon
5813− ++ toi |= [a=@rh] ^- (unit @s) (toi:ma a)
5814−```
5815−
5816−#### Examples
5817−
5818−```
5819− > (toi:rh .~~-2.085e2)
5820− [~ u=-208]
5821−
5822− > (toi:rh .~~-2.08e2)
5823− [~ u=-208]
5824−```
5825−
5826−---
5827−### `++drg:rh`
5828−
5829−`@rh` to decimal float
5830−
5831−Produces the decimal form of `a` using the Dragon4 algorithm. Guarantees
5832−accurate results for rounded floats.
5833−
5834−#### Accepts
5835−
5836−`a` is a `@rh`, a half-precision float.
5837−
5838−#### Produces
5839−
5840−A `dn`.
5841−
5842−#### Source
5843−
5844−```hoon
5845− ++ drg |= [a=@rh] ^- dn (drg:ma a)
5846−```
5847−
5848−#### Examples
5849−
5850−```
5851− > (drg:rh .~~-2.085e2)
5852− [%d s=%.n e=-1 a=2.085]
5853−
5854− > (drg:rh .~~-2.08e2)
5855− [%d s=%.n e=--0 a=208]
5856−```
5857−
5858−---
5859−### `++grd:rh`
5860−
5861−Decimal float to `@rh`
5862−
5863−Converts `a` from `dn` to `@rh`.
5864−
5865−#### Accepts
5866−
5867−`a` is `dn`.
5868−
5869−`a` is a `@rh`.
5870−
5871−#### Produces
5872−
5873−A `@rh`, a a half-precision float.
5874−
5875−#### Source
5876−
5877−```hoon
5878− ++ grd |= [a=dn] ^- @rh (grd:ma a)
5879− --
5880−```
5881−
5882−#### Examples
5883−
5884−```
5885− > (grd:rh [%d s=%.n e=--0 a=343])
5886− .~~-3.43e2
5887−```
5888−
5889−---