Re: pow(2, 1/2) != pow(2, 0.5) problem
- From: pete <pfiland@xxxxxxxxxxxxxx>
- Date: Wed, 15 Jun 2005 12:15:15 GMT
Michel Rouzic wrote:
> oh ok, i never know whether i get a float or int result, i mean, in my
> case i had to do 1.0/(int variable).
Actually, 1.0 is of type double.
> how would i do if i wanted to divide two integers as if they were
> floats without using some variable to transtype? just being curious
printf("%f\n", (double)1 / 2);
--
pete
.
- Follow-Ups:
- Re: pow(2, 1/2) != pow(2, 0.5) problem
- From: Michel Rouzic
- Re: pow(2, 1/2) != pow(2, 0.5) problem
- References:
- pow(2, 1/2) != pow(2, 0.5) problem
- From: Michel Rouzic
- Re: pow(2, 1/2) != pow(2, 0.5) problem
- From: Richard Bos
- Re: pow(2, 1/2) != pow(2, 0.5) problem
- From: Michel Rouzic
- Re: pow(2, 1/2) != pow(2, 0.5) problem
- From: David Resnick
- Re: pow(2, 1/2) != pow(2, 0.5) problem
- From: Michel Rouzic
- pow(2, 1/2) != pow(2, 0.5) problem
- Prev by Date: Re: padding mechanism in structures
- Next by Date: Re: allocation of local variables on stack
- Previous by thread: Re: pow(2, 1/2) != pow(2, 0.5) problem
- Next by thread: Re: pow(2, 1/2) != pow(2, 0.5) problem
- Index(es):
Relevant Pages
|