]> gitweb.factorcode.org Git - factor.git/blob - basis/compiler/tree/propagation/known-words/known-words-docs.factor
ec49f2e24a391609464fcbf749a6657529d70432
[factor.git] / basis / compiler / tree / propagation / known-words / known-words-docs.factor
1 USING: classes compiler.tree.propagation.info help.markup help.syntax math
2 math.intervals ;
3 IN: compiler.tree.propagation.known-words
4
5 HELP: binary-op-class
6 { $values { "info1" value-info-state } { "info2" value-info-state } { "newclass" class } }
7 { $description "Given two value infos return the math class which is large enough for both of them." }
8 { $examples
9   { $example
10     "USING: compiler.tree.propagation.known-words compiler.tree.propagation.info"
11     "kernel math prettyprint ;"
12     "bignum real [ <class-info> ] bi@ binary-op-class ."
13     "real"
14   }
15 } ;
16
17 HELP: unary-op-class
18 { $values { "info" value-info-state } { "newclass" class } }
19 { $description "Returns the smallest math class large enough to hold values of the value infos class." }
20 { $see-also binary-op-class } ;
21
22 HELP: number-valued
23 { $values
24   { "class" class } { "interval" interval }
25   { "class'" class } { "interval'" interval }
26 }
27 { $description "Ensure that the class is a subclass of " { $link number } "." } ;
28
29 HELP: fits-in-fixnum?
30 { $values { "interval" interval } { "?" "a boolean" } }
31 { $description "Checks if the interval is a subset of the " { $link fixnum } " interval. Used to see if arithmetic may overflow." }
32 { $examples
33   { $example
34     "USING: compiler.tree.propagation.known-words math.intervals prettyprint ;"
35     "full-interval fits-in-fixnum? ."
36     "f"
37   }
38 } ;