math.polynomials: update pdiff for no-integers-as-sequences (reported by rswarbrick)
parent
a55c8ee671
commit
c6fd20b107
|
@ -31,3 +31,5 @@ IN: math.polynomials.tests
|
|||
[ t ] [ { 1 1 1 } { 1 1 1 } p= ] unit-test
|
||||
[ { 0 0 } { 1 1 } ] [ { 1 1 1 1 } { 1 1 } pgcd ] unit-test
|
||||
|
||||
[ { 10 200 3000 } ] [ { 1 10 100 1000 } pdiff ] unit-test
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ PRIVATE>
|
|||
[ V{ 0 } clone V{ 1 } clone ] 2dip swap (pgcd) [ >array ] bi@ ;
|
||||
|
||||
: pdiff ( p -- p' )
|
||||
dup length v* { 0 } ?head drop ;
|
||||
dup length iota v* unclip drop ;
|
||||
|
||||
: polyval ( x p -- p[x] )
|
||||
[ length swap powers ] [ nip ] 2bi v. ;
|
||||
|
|
Loading…
Reference in New Issue