Skip to content

Commit 6f0e148

Browse files
committed
dfg now uses rational instead of f64
1 parent a0cf890 commit 6f0e148

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

crates/dfg/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ edition.workspace = true
55

66
[dependencies]
77
cranelift-entity.workspace = true
8+
malachite.workspace = true

crates/dfg/src/dfg.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use cranelift_entity::{EntityList, ListPool, PrimaryMap, entity_impl};
2+
use malachite::Rational;
23
use std::collections::HashMap;
34
use std::ops::{Index, IndexMut};
45
use std::slice::IterMut;
@@ -90,7 +91,7 @@ impl Dfg {
9091
self.nodes.push(node)
9192
}
9293

93-
pub fn add_const(&mut self, value: f64) -> NodeId {
94+
pub fn add_const(&mut self, value: Rational) -> NodeId {
9495
self.nodes.push(Node {
9596
node_type: NodeKind::Const(value),
9697
inputs: EntityList::new(),
@@ -298,7 +299,7 @@ pub enum ArithOp {
298299
pub enum NodeKind {
299300
Input,
300301
Output,
301-
Const(f64),
302+
Const(Rational),
302303
Op(ArithOp),
303304
}
304305

0 commit comments

Comments
 (0)