(
g: &Graph,
value: T,
st: ScalarType,
)
| 141 | } |
| 142 | |
| 143 | pub fn constant_scalar<T: TryInto<u128> + Not<Output = T> + TryInto<u8> + Copy>( |
| 144 | g: &Graph, |
| 145 | value: T, |
| 146 | st: ScalarType, |
| 147 | ) -> Result<Node> { |
| 148 | constant(g, TypedValue::from_scalar(value, st)?) |
| 149 | } |
| 150 | |
| 151 | pub fn multiply_fixed_point(node1: Node, node2: Node, precision: u64) -> Result<Node> { |
| 152 | node1.multiply(node2)?.truncate(1 << precision) |