[ 0 ] [ 5 [ 1 mod ] compile-call ] unit-test
[ 0 ] [ 5 [ 1 rem ] compile-call ] unit-test
+[ 0.5 ] [ 5.5 [ 1 mod ] compile-call ] unit-test
+[ 0.5 ] [ 5.5 [ 1 rem ] compile-call ] unit-test
[ 5 ] [ 5 [ -1 bitand ] compile-call ] unit-test
[ 0 ] [ 5 [ 0 bitand ] compile-call ] unit-test
-! Copyright (C) 2008, 2010 Slava Pestov, Daniel Ehrenberg.
+! Copyright (C) 2008, 2011 Slava Pestov, Daniel Ehrenberg.
! See http://factorcode.org/license.txt for BSD license.
USING: alien.c-types kernel sequences words fry generic
generic.single accessors classes.tuple classes classes.algebra
] [ drop f ] if
] "custom-inlining" set-word-prop
-: rem-custom-inlining ( #call -- quot/f )
- second value-info literal>> dup integer?
- [ power-of-2? [ 1 - bitand ] f ? ] [ drop f ] if ;
+: rem-custom-inlining ( inputs -- quot/f )
+ dup first value-info class integer class<= [
+ second value-info literal>> dup integer?
+ [ power-of-2? [ 1 - bitand ] f ? ] [ drop f ] if
+ ] [ drop f ] if ;
{
mod-integer-integer