Skip to content

Commit

Permalink
Replace legacy numeric constants core/std::f64::NAN with f64::NAN
Browse files Browse the repository at this point in the history
  • Loading branch information
busstoptaktik committed Jun 17, 2024
1 parent 1a35cc7 commit 02b3c87
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/inner_op/helmert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fn helmert_common(
let mut TT = [T[0], T[1], T[2]];
let mut SS = S;

let mut prev_t = std::f64::NAN;
let mut prev_t = f64::NAN;
let n = operands.len();
for i in 0..n {
let mut c = operands.get_coord(i);
Expand Down Expand Up @@ -167,10 +167,10 @@ pub const GAMUT: [OpParameter; 25] = [
OpParameter::Real { key: "ds", default: Some(0f64) }, // TODO: scale by 1e-6

// Epoch - "beginning of time for this transformation"
OpParameter::Real { key: "t_epoch", default: Some(std::f64::NAN) },
OpParameter::Real { key: "t_epoch", default: Some(f64::NAN) },

// Fixed observation time - ignore the fourth coordinate.
OpParameter::Real { key: "t_obs", default: Some(std::f64::NAN) },
OpParameter::Real { key: "t_obs", default: Some(f64::NAN) },
];

pub fn new(parameters: &RawParameters, _ctx: &dyn Context) -> Result<Op, Error> {
Expand Down Expand Up @@ -581,7 +581,7 @@ mod tests {
let definition = "
helmert exact convention = coordinate_frame
angular_velocity = 0.00150379, 0.00118346, 0.00120716
t_epoch = 2020.0
t_epoch = 2020.0
";
let op = ctx.op(definition)?;

Expand Down
2 changes: 1 addition & 1 deletion src/inner_op/somerc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ fn inv(op: &Op, _ctx: &dyn Context, operands: &mut dyn CoordinateSet) -> usize {
j -= 1;
}
if j <= 0 {
operands.set_xy(i, core::f64::NAN, core::f64::NAN);
operands.set_xy(i, f64::NAN, f64::NAN);
continue;
} else {
operands.set_xy(i, lam, phi);
Expand Down

0 comments on commit 02b3c87

Please sign in to comment.