Module: System::Collections::NumericLambdas

Extended by:
NumericLambdas
Included in:
NumericLambdas, F
Defined in:
lib/raskell/f.rb

Instance Method Summary collapse

Instance Method Details

#decObject



191
192
193
# File 'lib/raskell/f.rb', line 191

def dec
  @@dec||= ->(x) { x - 1 }
end

#div_byObject



211
212
213
# File 'lib/raskell/f.rb', line 211

def div_by
  @@div_by||= ->(y,x) { x / y}
end

#div_fromObject



207
208
209
# File 'lib/raskell/f.rb', line 207

def div_from
  @@div_from||= ->(x,y) { x / y }
end

#doubleObject



260
261
262
# File 'lib/raskell/f.rb', line 260

def double
  @@double||= slf.(plus)
end

#gtObject



235
236
237
# File 'lib/raskell/f.rb', line 235

def gt
  @@gt||= ->(x,y) { x > y }
end

#gteObject



243
244
245
# File 'lib/raskell/f.rb', line 243

def gte
  @@gte||= ->(x,y) { x >= y }
end

#incObject

numbers



187
188
189
# File 'lib/raskell/f.rb', line 187

def inc
  @@inc||= ->(x) { x + 1 }
end

#infObject



178
179
180
# File 'lib/raskell/f.rb', line 178

def inf
  Float::INFINITY
end

#infinityObject



170
171
172
# File 'lib/raskell/f.rb', line 170

def infinity
  Float::INFINITY
end

#is_gtObject



219
220
221
# File 'lib/raskell/f.rb', line 219

def is_gt
  @@is_gt||= ->(y,x) { x > y }
end

#is_gteObject



227
228
229
# File 'lib/raskell/f.rb', line 227

def is_gte
  @@is_gte||= ->(y,x) { x >= y }
end

#is_ltObject



223
224
225
# File 'lib/raskell/f.rb', line 223

def is_lt
  @@is_lt||= ->(y,x) { x < y }
end

#is_lteObject



231
232
233
# File 'lib/raskell/f.rb', line 231

def is_lte
  @@is_lte||= ->(y,x) { x <= y }
end

#ltObject



239
240
241
# File 'lib/raskell/f.rb', line 239

def lt
  @@lt||= ->(x,y) { x < y }
end

#lteObject



247
248
249
# File 'lib/raskell/f.rb', line 247

def lte
  @@lte||= ->(x,y) { x <= y }
end

#maxObject

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

#minObject



256
257
258
# File 'lib/raskell/f.rb', line 256

def min
  @@min||= ->(x,y) { x <= y ? x : y}
end

#negative_infinityObject



174
175
176
# File 'lib/raskell/f.rb', line 174

def negative_infinity
  -Float::INFINITY
end

#ninfObject



182
183
184
# File 'lib/raskell/f.rb', line 182

def ninf
  -Float::INFINITY
end

#plusObject



195
196
197
# File 'lib/raskell/f.rb', line 195

def plus
  @@plus||= ->(x,y) { x + y }
end

#squareObject



264
265
266
# File 'lib/raskell/f.rb', line 264

def square
  @@square||= slf.(times)
end

#sub_byObject



215
216
217
# File 'lib/raskell/f.rb', line 215

def sub_by
  @@sub_by||= ->(y,x) { x - y}
end

#sub_fromObject



203
204
205
# File 'lib/raskell/f.rb', line 203

def sub_from
  @@sub_from||= ->(x,y) { x - y }
end

#timesObject



199
200
201
# File 'lib/raskell/f.rb', line 199

def times
  @@times||= ->(x,y) { x * y }
end