Skip to content

Commit

Permalink
One more UnitStep example...
Browse files Browse the repository at this point in the history
and module I forgot to "git add"
  • Loading branch information
rocky committed Dec 28, 2024
1 parent f099f3b commit 440ac6b
Show file tree
Hide file tree
Showing 2 changed files with 776 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mathics/builtin/numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,10 @@ class UnitStep(Builtin):
>> UnitStep[0.7]
= 1
We can use 'UnitStep' on irrational numbers:
We can use 'UnitStep' on irrational numbers and infinities:
>> Map[UnitStep, {Pi, Infinity, -Infinity}]
= {1, 1, 0}
>> Table[UnitStep[x], {x, -3, 3}]
= {0, 0, 0, 1, 1, 1, 1}
Expand Down
Loading

0 comments on commit 440ac6b

Please sign in to comment.