avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] double precision bit representation


From: Parthasaradhi Nayani
Subject: Re: [avr-gcc-list] double precision bit representation
Date: Thu, 7 Jul 2005 08:10:30 -0700 (PDT)

Hello Kitts,

As of now there is no support for double in avr-gcc.
Though I never tried to use double, I guess it will
use only float. As for the byte pattern, if you have a
C compiler on your system, you could write program
wherein declare a pointer to unsigned char, reserve a
float and make the pointer point to the float and push
these values into the 4 bytes of float and then use
printf with %f to print the float value. HTH.

Nayani





--- Kitts <address@hidden> wrote:

> On Thursday 07 Jul 2005 5:00 am IST, Parthasaradhi
> Nayani wrote:
> Hello Nayani,
> 
> When you say avr-gcc supports only float and not
> double do you mean that 
> when a variable in declared as double, it is
> equivalent of declaring it as 
> float?
> 
> Thanks for giving me the decimal equivalent of the
> byte pattern. I would 
> like to know how you do it. I tried googling around
> to get info but failed. 
> May be i was not searching right!
> 
> -- 
> Cheers!
> Kitts
> 
> PN> Hello,
> PN> 
> PN> Currently avr-gcc supports only float and not
> double.
> PN> The byte pattern given in your query results in
> a
> PN> float value of -1.135254
> PN> 
> PN> Nayani P
> PN> 
> PN> 
> PN> --- Kitts <address@hidden> wrote:
> PN> 
> PN> > Hi all,
> PN> > 
> PN> > I would like to know how a variable declared
> as
> PN> > double is represented with 
> PN> > avr-libc. What is the maximum and minimum
> values
> PN> > that it can represent and 
> PN> > with what resolution? I am performing floating
> point
> PN> > math which fails in 
> PN> > certain occasion where i think it shouldn't.
> Hence
> PN> > my query...
> PN> > 
> PN> > For an example i have a double variable called
> PN> > "TempDouble" which is placed 
> PN> > at the following address in SRAM with each of
> the
> PN> > byte having the given 
> PN> > value. How do i interpret this value in
> decimal?
> PN> > 
> PN> > Ram Address:    $0B6F   $0B70   $0B71   $0B72
> PN> > Value:          00              50              91              3F
> PN> > 
> PN> > Thanks in Advance.
> PN> > -- 
> PN> > Cheers!
> PN> > Kitts
> PN> > 
> PN> > 
> PN> > 
> PN> >
> _______________________________________________
> PN> > AVR-GCC-list mailing list
> PN> > address@hidden
> PN> >
> PN>
>
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
> PN> > 
> PN> 
> PN> 
> PN>
> __________________________________________________
> PN> Do You Yahoo!?
> PN> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> PN> http://mail.yahoo.com 
> PN> 
> PN> 
> PN> _______________________________________________
> PN> AVR-GCC-list mailing list
> PN> address@hidden
> PN>
>
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
> PN> 
> 
> 
> 
> _______________________________________________
> AVR-GCC-list mailing list
> address@hidden
>
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
> 



                
__________________________________ 
Yahoo! Mail 
Stay connected, organized, and protected. Take the tour: 
http://tour.mail.yahoo.com/mailtour.html 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]