Module: Hornetseye::FLOAT_::Match
- Included in:
- Node
- Defined in:
- lib/multiarray/float.rb
Instance Method Summary collapse
-
#align(context) ⇒ Object
Perform type alignment.
-
#fit(*values) ⇒ Class
Method for matching elements of type FLOAT_.
Instance Method Details
#align(context) ⇒ Object
Perform type alignment
Align this type to another. This is used to prefer single-precision floating point in certain cases.
186 187 188 189 190 191 192 |
# File 'lib/multiarray/float.rb', line 186 def align( context ) if self < FLOAT_ and context < FLOAT_ context else super context end end |
#fit(*values) ⇒ Class
Method for matching elements of type FLOAT_
166 167 168 169 170 171 172 173 174 175 176 |
# File 'lib/multiarray/float.rb', line 166 def fit( *values ) if values.all? { |value| value.is_a? Float or value.is_a? Integer } if values.any? { |value| value.is_a? Float } DFLOAT else super *values end else super *values end end |