Re: [rust-dev] About const

2015-01-04 Thread Pim Schellart
Ok, thanks! > On 04 Jan 2015, at 17:57, Philippe Daouadi wrote: > > If you want a generic pi, you should use the one in the Float trait > > If you have > let x : f64 = ...; > x * Float::pi() will resolve to f64 pi > > Philippe > > On 01/04/2015 05:21 PM, Manish Goregaokar wrote: >> We have two

Re: [rust-dev] About const

2015-01-04 Thread Philippe Daouadi
If you want a generic pi, you should use the one in the Float trait If you have let x : f64 = ...; x * Float::pi() will resolve to f64 pi Philippe On 01/04/2015 05:21 PM, Manish Goregaokar wrote: We have two types of floats, there is a Pi of both precision levels. I don't think it's anything m

Re: [rust-dev] About const

2015-01-04 Thread Manish Goregaokar
We have two types of floats, there is a Pi of both precision levels. I don't think it's anything more than that. You should be able to cast between the two, but that's it I guess. Rust tries to give explicit control over such things. There is a Float trait (might have been renamed) if you want to

[rust-dev] About const

2015-01-04 Thread Pim Schellart
Dear Rust Developers, here is another ignorant question so feel free to ignore. When reading the guide I came across "std::f64::consts::PI” for pi. Now I was wondering why there are separate constants defined for 32 and 64 bit floats and how this will work with generics. Do you always have to de