Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working at all? #53

Closed
hakunin opened this issue Nov 4, 2019 · 3 comments
Closed

Not working at all? #53

hakunin opened this issue Nov 4, 2019 · 3 comments

Comments

@hakunin
Copy link

hakunin commented Nov 4, 2019

This is passing in my tests, am I using this wrong?

    ulps_eq!(12.3, 24.5);
    abs_diff_eq!(12.3, 24.5);
@hakunin
Copy link
Author

hakunin commented Nov 5, 2019

Using the code from example, all of these pass:

    abs_diff_eq!(1.1, 1.0);
    abs_diff_eq!(1.1, 1.0, epsilon = f64::EPSILON);

    relative_eq!(1.1, 1.0);
    relative_eq!(1.1, 1.0, epsilon = f64::EPSILON);
    relative_eq!(1.1, 1.0, max_relative = 1.0);
    relative_eq!(1.1, 1.0, epsilon = f64::EPSILON, max_relative = 1.0);
    relative_eq!(1.1, 1.0, max_relative = 1.0, epsilon = f64::EPSILON);

    ulps_eq!(1.1, 1.0);
    ulps_eq!(1.1, 1.0, epsilon = f64::EPSILON);
    ulps_eq!(1.1, 1.0, max_ulps = 4);
    ulps_eq!(1.1, 1.0, epsilon = f64::EPSILON, max_ulps = 4);
    ulps_eq!(1.1, 1.0, max_ulps = 4, epsilon = f64::EPSILON);

My Cargo.toml:

approx = "0.3.2"
bincode = "1.2"
circular-queue = "0.2.2"
chrono = { version = "0.4", features = ["serde"] }
clap = "2.33.0"
#crossbeam = "0.7"
#crossbeam-utils = "0.6.6"
csv = "1.1"
prettytable-rs = "^0.8"
rand = "0.6.5"
rayon = "1.1"
regex = "0.1.41"
serde = { version = "1", features = ["derive"] }
serde_json = "1.0"
strum = "0.16.0"
strum_macros = "0.16.0"
ta-lib-wrapper = "0.2.0"
time = "0.1.12"

Can I run any diagnosting for you?

@hakunin
Copy link
Author

hakunin commented Nov 5, 2019

Aaahhh, I need to run the assert_ prefixed functions!

@hakunin hakunin closed this as completed Nov 5, 2019
@ryan-williams
Copy link

This bit me as well, the example code at https://docs.rs/approx/latest/approx/ is misleading.

image

Those are all no-ops / emit "unused return value" warnings.

I tried to improve it with #84.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants