File: test-heaviside_step.2.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 (15 lines) | stat: -rw-r--r-- 259 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
rm(list=ls())

assert('heaviside_2', {
  h.step(n) %::% numeric : numeric
  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)

  has_error(h.step("a"))
})