]> gitweb.factorcode.org Git - factor.git/blob - basis/specialized-arrays/double/double.factor
change math.floats.env tests not to use any libm functions, which don't reliably...
[factor.git] / basis / specialized-arrays / double / double.factor
1 USE: specialized-arrays.functor
2 IN: specialized-arrays.double
3
4 << "double" define-array >>
5
6 ! Specializer hints. These should really be generalized, and placed
7 ! somewhere else
8 USING: hints math.vectors arrays kernel math accessors sequences ;
9
10 HINTS: <double-array> { 2 } { 3 } ;
11
12 HINTS: (double-array) { 2 } { 3 } ;
13
14 ! Type functions
15 USING: words classes.algebra compiler.tree.propagation.info
16 math.intervals ;
17
18 \ norm-sq [
19     class>> double-array class<= [ float 0. 1/0. [a,b] <class/interval-info> ] [ object-info ] if
20 ] "outputs" set-word-prop
21
22 \ distance [
23     [ class>> double-array class<= ] both?
24     [ float 0. 1/0. [a,b] <class/interval-info> ] [ object-info ] if
25 ] "outputs" set-word-prop