File: test-heaviside_step.1.R

package info (click to toggle)
r-cran-lambda.r 1.2.4-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 284 kB
  • sloc: sh: 9; makefile: 2
file content (10 lines) | stat: -rw-r--r-- 183 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
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)
})