tests/testit/test-heaviside_step.1.R

assert('heaviside_1', {
  h.step(n) %when% { n < 0 } %as% { 0 }
  h.step(0) %as% 0.5
  h.step(n) %as% 1
  seal(h.step)

  (h.step(-1) == 0)
  (h.step(0) == 0.5)
  (h.step(1) == 1)
})

Try the lambda.r package in your browser

Any scripts or data that you put into this service are public.

lambda.r documentation built on Sept. 18, 2019, 5:02 p.m.