Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

chore(field): improve field formatting #84

Merged
merged 1 commit into from
Feb 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion acir_field/src/generic_ark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@ impl<F: PrimeField> std::fmt::Display for FieldElement<F> {
break;
}
}
return write!(f, "2{}", superscript(bit_index));
return match bit_index {
0 => write!(f, "1"),
1 => write!(f, "2"),
2 => write!(f, "4"),
3 => write!(f, "8"),
_ => write!(f, "2{}", superscript(bit_index)),
};
}

// Check if number is a multiple of a power of 2.
Expand Down