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

(0.1).pow(20) == 0 #1

Open
safinaskar opened this issue May 8, 2022 · 0 comments
Open

(0.1).pow(20) == 0 #1

safinaskar opened this issue May 8, 2022 · 0 comments

Comments

@safinaskar
Copy link

@davidli2010 , in yashan-technologies/decimal-rs#6 you told me that pgnumeric has "up to 1000 digits of precision". But it seems this is not true. Consider this code:

    use pgnumeric::NumericBuf;
    let a: NumericBuf = "0.1".parse::<NumericBuf>().unwrap().pow("20".parse::<NumericBuf>().unwrap().as_numeric()).unwrap();
    assert!(a > "0".parse::<NumericBuf>().unwrap());

I use pgnumeric 0.2.1. I think this code should run successfully. But assertion fails. I. e. pgnumeric thinks that 0.1 ^ 20 > 0 is not true

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

No branches or pull requests

1 participant