Skip to content

Commit

Permalink
Use cfg-elif for number module
Browse files Browse the repository at this point in the history
  • Loading branch information
raviqqe committed Jan 23, 2025
1 parent 6710d10 commit 76b8897
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions vm/src/number.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
use crate::{value::Value, Error};
use cfg_elif::expr::feature;
use cfg_elif::item;
use core::{
fmt::{self, Display, Formatter},
ops::{Add, Div, Mul, Rem, Sub},
};

/// A number representation.
#[cfg(feature = "float")]
pub type NumberRepresentation = f64;

/// A number representation.
#[cfg(not(feature = "float"))]
pub type NumberRepresentation = i64;
item::feature!(if ("float") {
/// A number representation.
pub type NumberRepresentation = f64;
} else {
/// A number representation.
pub type NumberRepresentation = i64;
});

/// A number.
///
Expand Down

0 comments on commit 76b8897

Please sign in to comment.