Ok, thanks!
> On 04 Jan 2015, at 17:57, Philippe Daouadi <blastro...@free.fr> 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 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 use generics.
>> 
>> -Manish Goregaokar
>> 
>> On Sun, Jan 4, 2015 at 3:07 PM, Pim Schellart <p.schell...@gmail.com> wrote:
>> 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 define 
>> two functions to work on f32 and f64 or is std::f64::consts::PI cast down to 
>> f32 in an equation with 32 bit variables? Is there also a general `typeless’ 
>> PI (or other fundamental constants), as in Go for example?
>> 
>> Kind Regards,
>> 
>> Pim
>> _______________________________________________
>> Rust-dev mailing list
>> Rust-dev@mozilla.org
>> https://mail.mozilla.org/listinfo/rust-dev
>> 
>> 
>> 
>> _______________________________________________
>> Rust-dev mailing list
>> 
>> Rust-dev@mozilla.org
>> https://mail.mozilla.org/listinfo/rust-dev
> 

_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to