feat(core): minor additions to the API

This commit is contained in:
Anand Balakrishnan 2023-04-16 18:41:21 -07:00
parent c666498ac0
commit e22410eea8
No known key found for this signature in database
3 changed files with 19 additions and 4 deletions

View file

@ -24,7 +24,7 @@ pub use cast::*;
pub use cmp_ops::*;
use itertools::Itertools;
pub use num_ops::*;
use num_traits::NumCast;
use num_traits::{Num, NumCast};
pub use traits::*;
use utils::intersect_bounds;
@ -396,6 +396,16 @@ impl<T> Signal<T> {
}
}
impl<T: Num> Signal<T> {
pub fn zero() -> Self {
Signal::constant(T::zero())
}
pub fn one() -> Self {
Signal::constant(T::one())
}
}
#[cfg(any(test, feature = "arbitrary"))]
pub mod arbitrary {
use proptest::prelude::*;