Skip to content

Commit

Permalink
Updated f64-to-decimal conversion logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Zack Slayton committed May 15, 2024
1 parent 88f6fba commit 0929c8b
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 228 deletions.
10 changes: 10 additions & 0 deletions src/types/decimal/coefficient.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ pub struct Coefficient {
}

impl Coefficient {
pub const ZERO: Coefficient = Coefficient {
sign: Sign::Positive,
magnitude: UInt::ZERO,
};

pub const NEGATIVE_ZERO: Coefficient = Coefficient {
sign: Sign::Negative,
magnitude: UInt::ZERO,
};

pub(crate) fn new<I: Into<Magnitude>>(sign: Sign, magnitude: I) -> Self {
let magnitude: Magnitude = magnitude.into();
let magnitude: UInt = magnitude.into();
Expand Down

0 comments on commit 0929c8b

Please sign in to comment.