Merge branch 'master' of git://factorcode.org/git/factor
commit
af91ba0dfc
|
@ -28,8 +28,8 @@ IN: compiler.tree.propagation.recursive
|
|||
{
|
||||
{ [ 2dup interval-subset? ] [ empty-interval ] }
|
||||
{ [ over empty-interval eq? ] [ empty-interval ] }
|
||||
{ [ 2dup interval>= t eq? ] [ 1./0. [a,a] ] }
|
||||
{ [ 2dup interval<= t eq? ] [ -1./0. [a,a] ] }
|
||||
{ [ 2dup interval>= t eq? ] [ 1/0. [a,a] ] }
|
||||
{ [ 2dup interval<= t eq? ] [ -1/0. [a,a] ] }
|
||||
[ [-inf,inf] ]
|
||||
} cond interval-union nip ;
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ IN: lcs
|
|||
0 1 ? + [ [ 1+ ] bi@ ] dip min min ;
|
||||
|
||||
: lcs-step ( insert delete change same? -- next )
|
||||
1 -1./0. ? + max max ; ! -1./0. is -inf (float)
|
||||
1 -1/0. ? + max max ; ! -1/0. is -inf (float)
|
||||
|
||||
:: loop-step ( i j matrix old new step -- )
|
||||
i j 1+ matrix nth nth ! insertion
|
||||
|
|
|
@ -81,7 +81,7 @@ PRIVATE>
|
|||
2dup [ real? ] both? [ drop 0 >= ] [ 2drop f ] if ; inline
|
||||
|
||||
: 0^ ( x -- z )
|
||||
dup zero? [ drop 0./0. ] [ 0 < 1./0. 0 ? ] if ; inline
|
||||
dup zero? [ drop 0/0. ] [ 0 < 1/0. 0 ? ] if ; inline
|
||||
|
||||
: (^mod) ( n x y -- z )
|
||||
make-bits 1 [
|
||||
|
|
|
@ -40,13 +40,13 @@ TUPLE: interval { from read-only } { to read-only } ;
|
|||
: [a,a] ( a -- interval )
|
||||
closed-point dup <interval> ; foldable
|
||||
|
||||
: [-inf,a] ( a -- interval ) -1./0. swap [a,b] ; inline
|
||||
: [-inf,a] ( a -- interval ) -1/0. swap [a,b] ; inline
|
||||
|
||||
: [-inf,a) ( a -- interval ) -1./0. swap [a,b) ; inline
|
||||
: [-inf,a) ( a -- interval ) -1/0. swap [a,b) ; inline
|
||||
|
||||
: [a,inf] ( a -- interval ) 1./0. [a,b] ; inline
|
||||
: [a,inf] ( a -- interval ) 1/0. [a,b] ; inline
|
||||
|
||||
: (a,inf] ( a -- interval ) 1./0. (a,b] ; inline
|
||||
: (a,inf] ( a -- interval ) 1/0. (a,b] ; inline
|
||||
|
||||
: [-inf,inf] ( -- interval ) full-interval ; inline
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ FUNCTION: PangoLayoutLine*
|
|||
pango_layout_get_line_readonly ( PangoLayout* layout, int line ) ;
|
||||
|
||||
FUNCTION: void
|
||||
pango_layout_line_index_to_x ( PangoLayoutLine* line, int index_, gboolean trailing, int* x_pos ) ;
|
||||
pango_layout_line_index_to_x ( PangoLayoutLine* line, int index_, uint trailing, int* x_pos ) ;
|
||||
|
||||
FUNCTION: gboolean
|
||||
pango_layout_line_x_to_index ( PangoLayoutLine* line, int x_pos, int* index_, int* trailing ) ;
|
||||
|
@ -122,7 +122,7 @@ MEMO: missing-font-metrics ( font -- metrics )
|
|||
: line-offset>x ( layout n -- x )
|
||||
#! n is an index into the UTF8 encoding of the text
|
||||
[ drop first-line ] [ swap string>> >utf8-index ] 2bi
|
||||
f 0 <int> [ pango_layout_line_index_to_x ] keep
|
||||
0 0 <int> [ pango_layout_line_index_to_x ] keep
|
||||
*int pango>float ;
|
||||
|
||||
: x>line-offset ( layout x -- n )
|
||||
|
|
|
@ -199,7 +199,7 @@ find_architecture() {
|
|||
|
||||
write_test_program() {
|
||||
echo "#include <stdio.h>" > $C_WORD.c
|
||||
echo "int main(){printf(\"%d\", 8*sizeof(void*)); return 0; }" >> $C_WORD.c
|
||||
echo "int main(){printf(\"%ld\", 8*sizeof(void*)); return 0; }" >> $C_WORD.c
|
||||
}
|
||||
|
||||
c_find_word_size() {
|
||||
|
|
|
@ -25,7 +25,7 @@ $nl
|
|||
ABOUT: "number-strings"
|
||||
|
||||
HELP: digits>integer
|
||||
{ $values { "seq" "a sequence of integers" } { "radix" "an integer between 2 and 36" } { "n" integer } }
|
||||
{ $values { "seq" "a sequence of integers" } { "radix" "an integer between 2 and 36" } { "n/f" { $maybe integer } } }
|
||||
{ $description "Converts a sequence of digits (with most significant digit first) into an integer." }
|
||||
{ $notes "This is one of the factors of " { $link string>number } "." } ;
|
||||
|
||||
|
|
|
@ -227,7 +227,7 @@ unit-test
|
|||
[ -3 10 nth ] must-fail
|
||||
[ 11 10 nth ] must-fail
|
||||
|
||||
[ -1./0. 0 delete-nth ] must-fail
|
||||
[ -1/0. 0 delete-nth ] must-fail
|
||||
[ "" ] [ "" [ CHAR: \s = ] trim ] unit-test
|
||||
[ "" ] [ "" [ CHAR: \s = ] trim-head ] unit-test
|
||||
[ "" ] [ "" [ CHAR: \s = ] trim-tail ] unit-test
|
||||
|
|
|
@ -66,6 +66,12 @@ ARTICLE: "syntax-floats" "Float syntax"
|
|||
"7.e13"
|
||||
"1.0e-5"
|
||||
}
|
||||
"There are three special float values:"
|
||||
{ $table
|
||||
{ "Positive infinity" { $snippet "1/0." } }
|
||||
{ "Negative infinity" { $snippet "-1/0." } }
|
||||
{ "Not-a-number" { $snippet "0/0." } }
|
||||
}
|
||||
"More information on floats can be found in " { $link "floats" } "." ;
|
||||
|
||||
ARTICLE: "syntax-complex-numbers" "Complex number syntax"
|
||||
|
|
|
@ -42,7 +42,7 @@ PRIVATE>
|
|||
#! gamma(x) = integral 0..inf [ t^(x-1) exp(-t) ] dt
|
||||
#! gamma(n+1) = n! for n > 0
|
||||
dup { [ 0.0 <= ] [ 1.0 mod zero? ] } 1&& [
|
||||
drop 1./0.
|
||||
drop 1/0.
|
||||
] [
|
||||
[ abs gamma-lanczos6 ] keep dup 0 > [ drop ] [ gamma-neg ] if
|
||||
] if ;
|
||||
|
@ -51,7 +51,7 @@ PRIVATE>
|
|||
#! gammaln(x) is an alternative when gamma(x)'s range
|
||||
#! varies too widely
|
||||
dup 0 < [
|
||||
drop 1./0.
|
||||
drop 1/0.
|
||||
] [
|
||||
[ abs gammaln-lanczos6 ] keep dup 0 > [ drop ] [ gamma-neg ] if
|
||||
] if ;
|
||||
|
|
|
@ -1,15 +1,16 @@
|
|||
! Copyright (C) 2009 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors assocs db.sqlite furnace furnace.actions furnace.alloy
|
||||
furnace.auth furnace.auth.features.deactivate-user
|
||||
USING: accessors assocs db.sqlite furnace furnace.actions
|
||||
furnace.alloy furnace.auth furnace.auth.features.deactivate-user
|
||||
furnace.auth.features.edit-profile
|
||||
furnace.auth.features.recover-password
|
||||
furnace.auth.features.registration furnace.auth.login
|
||||
furnace.boilerplate furnace.redirection html.forms http.server
|
||||
http.server.dispatchers kernel namespaces site-watcher site-watcher.db
|
||||
site-watcher.private urls validators io.sockets.secure.unix.debug
|
||||
io.servers.connection db db.tuples sequences webapps.site-watcher.common
|
||||
webapps.site-watcher.watching webapps.site-watcher.spidering ;
|
||||
io.servers.connection io.files.temp db db.tuples sequences
|
||||
webapps.site-watcher.common webapps.site-watcher.watching
|
||||
webapps.site-watcher.spidering ;
|
||||
QUALIFIED: assocs
|
||||
IN: webapps.site-watcher
|
||||
|
||||
|
|
Loading…
Reference in New Issue