mirror of
https://github.com/urbit/developers.urbit.org.git
synced 2024-09-11 13:55:59 +03:00
commit
032e77a4be
@ -241,12 +241,7 @@ An [`atom`](/reference/glossary/atom).
|
|||||||
~/ %div
|
~/ %div
|
||||||
|: [a=`@`1 b=`@`1]
|
|: [a=`@`1 b=`@`1]
|
||||||
^- @
|
^- @
|
||||||
~_ leaf+"divide-by-zero"
|
-:(dvr a b)
|
||||||
?< =(0 b)
|
|
||||||
=+ c=0
|
|
||||||
|-
|
|
||||||
?: (lth a b) c
|
|
||||||
$(a (sub a b), c +(c))
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Examples
|
#### Examples
|
||||||
@ -302,10 +297,14 @@ A cell of [`atoms`](/reference/glossary/atom).
|
|||||||
|
|
||||||
```hoon
|
```hoon
|
||||||
++ dvr
|
++ dvr
|
||||||
~/ %dvr
|
|: [a=`@`1 b=`@`1]
|
||||||
|= [a=@ b=@]
|
|
||||||
^- [p=@ q=@]
|
^- [p=@ q=@]
|
||||||
[(div a b) (mod a b)]
|
~_ leaf+"divide-by-zero"
|
||||||
|
?< =(0 b)
|
||||||
|
=+ c=0
|
||||||
|
|-
|
||||||
|
?: (lth a b) [c a]
|
||||||
|
$(a (sub a b), c +(c))
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Examples
|
#### Examples
|
||||||
|
Loading…
Reference in New Issue
Block a user