This commit is contained in:
Max G 2015-08-03 20:33:57 +03:00
parent 032e7d7dcf
commit f78f794d42

View File

@ -1,4 +1,4 @@
:::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
!::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::: :::::: Preface ::::::
:::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::
?> ?=(@ .) :: atom subject
@ -1523,6 +1523,18 @@
=. o (^add (^mul o 10) ?:(q +(u) u))
[k o]
::
++ toi
|= [a=[e=@s a=@u]] ^- fn
?. =((cmp:si e.a --0) -1) [%f & a]
=+ x=(abs:si e.a)
=+ y=(rsh 0 x a.a)
?: |(=(r %d) =(r %z)) [%f & --0 y]
=+ z=(end 0 x a.a)
?: |(=(r %u) =(r %a)) [%f & --0 ?~(z y +(y))]
=+ i=(bex (dec x))
?: &(=(z i) =((dis y 1) 0)) [%f & --0 y]
?: (^lth z i) [%f & --0 y] [%f & --0 +(y)]
::
++ ned
|= [a=fn] ^- [%f s=? e=@s a=@u]
?: ?=([%f *] a) a
@ -1717,6 +1729,13 @@
?: (syn:si e.a)
(mul [%f s.a --0 a.a] [%f & e.a (pow 5 q)])
(div [%f s.a --0 a.a] [%f & (sun:si q) (pow 5 q)])
::
++ toi :: round to integer
|= [a=fn] ^- fn
?. ?=([%f *] a) a
?~ a.a [%f s.a zer]
?: s.a (^toi +>.a)
(fli =.(r swr (^toi +>.a)))
--
::
++ ff :: ieee754 format