Module: System::Collections::NumericLambdas
Instance Method Summary collapse
- #dec ⇒ Object
- #div_by ⇒ Object
- #div_from ⇒ Object
- #double ⇒ Object
- #gt ⇒ Object
- #gte ⇒ Object
-
#inc ⇒ Object
numbers.
- #inf ⇒ Object
- #infinity ⇒ Object
- #is_gt ⇒ Object
- #is_gte ⇒ Object
- #is_lt ⇒ Object
- #is_lte ⇒ Object
- #lt ⇒ Object
- #lte ⇒ Object
-
#max ⇒ Object
insert ln, lg, log, log_base, e, pi, exp/pow, square, cube, nth_root, sqrt here later.
- #min ⇒ Object
- #negative_infinity ⇒ Object
- #ninf ⇒ Object
- #plus ⇒ Object
- #square ⇒ Object
- #sub_by ⇒ Object
- #sub_from ⇒ Object
- #times ⇒ Object
Instance Method Details
#dec ⇒ Object
191 192 193 |
# File 'lib/raskell/f.rb', line 191 def dec @@dec||= ->(x) { x - 1 } end |
#div_by ⇒ Object
211 212 213 |
# File 'lib/raskell/f.rb', line 211 def div_by @@div_by||= ->(y,x) { x / y} end |
#div_from ⇒ Object
207 208 209 |
# File 'lib/raskell/f.rb', line 207 def div_from @@div_from||= ->(x,y) { x / y } end |
#double ⇒ Object
260 261 262 |
# File 'lib/raskell/f.rb', line 260 def double @@double||= slf.(plus) end |
#gt ⇒ Object
235 236 237 |
# File 'lib/raskell/f.rb', line 235 def gt @@gt||= ->(x,y) { x > y } end |
#gte ⇒ Object
243 244 245 |
# File 'lib/raskell/f.rb', line 243 def gte @@gte||= ->(x,y) { x >= y } end |
#inc ⇒ Object
numbers
187 188 189 |
# File 'lib/raskell/f.rb', line 187 def inc @@inc||= ->(x) { x + 1 } end |
#inf ⇒ Object
178 179 180 |
# File 'lib/raskell/f.rb', line 178 def inf Float::INFINITY end |
#infinity ⇒ Object
170 171 172 |
# File 'lib/raskell/f.rb', line 170 def infinity Float::INFINITY end |
#is_gt ⇒ Object
219 220 221 |
# File 'lib/raskell/f.rb', line 219 def is_gt @@is_gt||= ->(y,x) { x > y } end |
#is_gte ⇒ Object
227 228 229 |
# File 'lib/raskell/f.rb', line 227 def is_gte @@is_gte||= ->(y,x) { x >= y } end |
#is_lt ⇒ Object
223 224 225 |
# File 'lib/raskell/f.rb', line 223 def is_lt @@is_lt||= ->(y,x) { x < y } end |
#is_lte ⇒ Object
231 232 233 |
# File 'lib/raskell/f.rb', line 231 def is_lte @@is_lte||= ->(y,x) { x <= y } end |
#lt ⇒ Object
239 240 241 |
# File 'lib/raskell/f.rb', line 239 def lt @@lt||= ->(x,y) { x < y } end |
#lte ⇒ Object
247 248 249 |
# File 'lib/raskell/f.rb', line 247 def lte @@lte||= ->(x,y) { x <= y } end |
#max ⇒ Object
insert ln, lg, log, log_base, e, pi, exp/pow, square, cube, nth_root, sqrt here later
252 253 254 |
# File 'lib/raskell/f.rb', line 252 def max @@max||= ->(x,y) { x >= y ? x : y} end |
#min ⇒ Object
256 257 258 |
# File 'lib/raskell/f.rb', line 256 def min @@min||= ->(x,y) { x <= y ? x : y} end |
#negative_infinity ⇒ Object
174 175 176 |
# File 'lib/raskell/f.rb', line 174 def negative_infinity -Float::INFINITY end |
#ninf ⇒ Object
182 183 184 |
# File 'lib/raskell/f.rb', line 182 def ninf -Float::INFINITY end |
#plus ⇒ Object
195 196 197 |
# File 'lib/raskell/f.rb', line 195 def plus @@plus||= ->(x,y) { x + y } end |
#square ⇒ Object
264 265 266 |
# File 'lib/raskell/f.rb', line 264 def square @@square||= slf.(times) end |
#sub_by ⇒ Object
215 216 217 |
# File 'lib/raskell/f.rb', line 215 def sub_by @@sub_by||= ->(y,x) { x - y} end |
#sub_from ⇒ Object
203 204 205 |
# File 'lib/raskell/f.rb', line 203 def sub_from @@sub_from||= ->(x,y) { x - y } end |
#times ⇒ Object
199 200 201 |
# File 'lib/raskell/f.rb', line 199 def times @@times||= ->(x,y) { x * y } end |