Skip to content

Commit e3e8e3e

Browse files
authored
Merge pull request #26 from tspiteri/more-accurate-mile
More accurate factors for meter to inch, feet, yard, furlong, mile.
2 parents bc261d1 + 521ba68 commit e3e8e3e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/length.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ pub const METER_KILOMETER_FACTOR: f64 = 0.001;
2222
// Constants, imperial
2323

2424
/// Number of inches in a meter
25-
pub const METER_INCH_FACTOR: f64 = 1000.0 / 25.4;
25+
pub const METER_INCH_FACTOR: f64 = 10000.0 / 254.0;
2626
/// Number of feet in a meter
27-
pub const METER_FEET_FACTOR: f64 = 1000.0 / (25.4 * 12.0);
27+
pub const METER_FEET_FACTOR: f64 = 10000.0 / (254.0 * 12.0);
2828
/// Number of yards in a meter
29-
pub const METER_YARD_FACTOR: f64 = 1000.0 / (25.4 * 12.0 * 3.0);
29+
pub const METER_YARD_FACTOR: f64 = 10000.0 / (254.0 * 12.0 * 3.0);
3030
/// Number of furlongs in a meter
31-
pub const METER_FURLONG_FACTOR: f64 = 1000.0 / (25.4 * 12.0 * 3.0 * 220.0);
31+
pub const METER_FURLONG_FACTOR: f64 = 10000.0 / (254.0 * 12.0 * 3.0 * 220.0);
3232
/// Number of miles in a meter
33-
pub const METER_MILE_FACTOR: f64 = 1000.0 / (25.4 * 12.0 * 3.0 * 1760.0);
33+
pub const METER_MILE_FACTOR: f64 = 10000.0 / (254.0 * 12.0 * 3.0 * 1760.0);
3434

3535
/// The Length struct can be used to deal with lengths in a common way.
3636
/// Common metric and imperial units are supported.

0 commit comments

Comments
 (0)