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

Commit

Permalink
Better performance with inline functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Razican committed Sep 23, 2015
1 parent 0c63b20 commit 4c9a436
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "vsop87"
version = "1.0.0"
version = "1.1.0-dev"
authors = ["Razican <admin@razican.com>"]
license = "MIT/Apache-2.0"
readme = "README.md"
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ mod neptune;

use std::f64::consts::PI;

#[inline]
fn calculate_t(jde: f64) -> f64{
return (jde - 2451545_f64)/365250_f64
}

#[inline]
fn calculate_var(t: f64, var: &[(f64, f64, f64)]) -> f64 {
var.iter().fold(0_f64, |term, &(a, b, c)| term + a*(b + c*t).cos())
}
Expand Down

0 comments on commit 4c9a436

Please sign in to comment.