-- crypto sig11
+- %allot-bignum-signed-2 is broken on both platforms
+- sometimes fep when closing window
+- windows rollover broken again
+ ui:
-- sometimes fep when closing window
-- windows rollover broken again
+- dataflow view of [ { array } declare first ] is wrong
- docs: don't pass volatile aliens to callbacks
- live search: timer delay would be nice
- menu should stay up if mouse button released
+ compiler/ffi:
-- %allot-bignum-signed-2 is broken on both platforms
+- optimization: if one branch throws an error, then we need to infer
+ types based solely on the other branch
+- cross-word type inference
- callback scheduling issue
- amd64 structs-by-value bug
- intrinsic fixnum>float float>fixnum fixnum>bignum bignum>fixnum
: most-positive-fixnum ( -- n ) first-bignum 1- ;
: most-negative-fixnum ( -- n ) first-bignum neg ;
-
-M: float >integer
- dup most-negative-fixnum most-positive-fixnum between?
- [ >fixnum ] [ >bignum ] if ;
M: real <=> - ;
: fp-nan? ( float -- ? )
- double>bits -51 shift BIN: 111111111111 [ bitand ] keep = ;
+ double>bits -51 shift BIN: 111111111111 [ bitand ] keep
+ number= ;
M: float zero?
dup 0.0 float= swap -0.0 float= or ;
UNION: integer fixnum bignum ;
-: even? ( n -- ? ) 1 bitand 0 = ;
+: even? ( n -- ? ) 1 bitand zero? ;
-: odd? ( n -- ? ) 1 bitand 1 = ;
+: odd? ( n -- ? ) 1 bitand 1 number= ;
: (gcd) ( b a y x -- a d )
dup zero? [
tuck /mod >r pick * swap >r swapd - r> r> (gcd)
] if ; inline
-: gcd ( x y -- a d ) 0 1 2swap (gcd) abs ; foldable
+: gcd ( x y -- a d )
+ 0 1 2swap (gcd) dup 0 < [ neg ] when ; foldable
: (next-power-of-2) ( i n -- n )
2dup >= [
2dup gcd nip tuck /i >r /i r> fraction>
] if ;
-M: integer >integer ;
-
M: fixnum >fixnum ;
M: fixnum >bignum fixnum>bignum ;
M: fixnum >float fixnum>float ;
IN: math
USING: errors generic kernel math-internals ;
-GENERIC: >integer ( x -- y ) foldable
GENERIC: >fixnum ( x -- y ) foldable
GENERIC: >bignum ( x -- y ) foldable
GENERIC: >float ( x -- y ) foldable
: power-of-2? ( n -- ? )
dup 0 > [
- dup dup neg bitand =
+ dup dup neg bitand number=
] [
drop f
] if ; foldable
: log2 ( n -- b )
{
{ [ dup 0 <= ] [ "log2 expects positive inputs" throw ] }
- { [ dup 1 = ] [ drop 0 ] }
+ { [ dup 1 number= ] [ drop 0 ] }
{ [ t ] [ -1 shift log2 1+ ] }
} cond ; foldable
: ratio+d ( a/b c/d -- b*d )
denominator swap denominator * ; inline
-M: ratio >integer >fraction /i ;
-
-M: ratio >fixnum >integer >fixnum ;
-M: ratio >bignum >integer >bignum ;
+M: ratio >fixnum >fraction /i >fixnum ;
+M: ratio >bignum >fraction /i >bignum ;
M: ratio < scale < ;
M: ratio <= scale <= ;