mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
Add floating point addition
This commit is contained in:
parent
71b7ee7fab
commit
244113ede2
5 changed files with 138 additions and 3 deletions
|
@ -184,6 +184,9 @@ where
|
|||
Layout::Builtin(Builtin::Int64) => {
|
||||
self.build_num_add_i64(sym, &args[0], &args[1])
|
||||
}
|
||||
Layout::Builtin(Builtin::Float64) => {
|
||||
self.build_num_add_f64(sym, &args[0], &args[1])
|
||||
}
|
||||
x => Err(format!("layout, {:?}, not implemented yet", x)),
|
||||
}
|
||||
}
|
||||
|
@ -213,6 +216,15 @@ where
|
|||
src2: &Symbol,
|
||||
) -> Result<(), String>;
|
||||
|
||||
/// build_num_add_f64 stores the sum of src1 and src2 into dst.
|
||||
/// It only deals with inputs and outputs of f64 type.
|
||||
fn build_num_add_f64(
|
||||
&mut self,
|
||||
dst: &Symbol,
|
||||
src1: &Symbol,
|
||||
src2: &Symbol,
|
||||
) -> Result<(), String>;
|
||||
|
||||
/// build_num_sub_i64 stores the `src1 - src2` difference into dst.
|
||||
/// It only deals with inputs and outputs of i64 type.
|
||||
fn build_num_sub_i64(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue