Best regards
Li
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the
BlackBerry® mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry® DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1
_______________________________________________
Contiki-developers mailing list
Contiki-d...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/contiki-developers
> Date: Mon, 19 Sep 2011 08:38:30 +0800 (CST)
> From: Aborigines <kid...@mail.ustc.edu.cn>
> Subject: [Contiki-developers] Including math.h in contiki
> To: contiki-d...@lists.sourceforge.net
> Message-ID: <21968167.1085991316392710985.JavaMail.coremail@mailweb>
> Content-Type: text/plain; charset=us-ascii
Peter
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure contains a
> definitive record of customers, application performance, security
> threats, fraudulent activity and more. Splunk takes this data and makes
> sense of it. Business sense. IT sense. Common sense.
> http://p.sf.net/sfu/splunk-d2dcopy1
> _______________________________________________
> Contiki-developers mailing list
> Contiki-d...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/contiki-developers
>
>
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
> Date: Tue, 20 Sep 2011 13:17:46 +0100
> From: Mohammad Abdellatif <moh.abd...@gmail.com>
> Subject: Re: [Contiki-developers] Including math.h in contiki
> To: Contiki developer mailing list
> <contiki-d...@lists.sourceforge.net>
> Message-ID:
> <CAH5uiRCEaqBEwFjyom2sX9=FxNyX-j6QMdO4kd9FJ8kkn=7m...@mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> And if you're using msp430-libc, I believe printf does not support
> floating point numbers.
>
> True.. i tried everything and still couldnt print them
>
> *Mohammad Abdellatif*
> *
> *
> *Phd student at Faculty of Engineering University of Porto (FEUP)*
> *Researcher at Inesc Porto, UTM, WiN *
> *http://win.inescporto.pt/mma* <http://win.inescporto.pt/mma>
> -------------- next part --------------
> An HTML attachment was scrubbed...
>
> ------------------------------
>
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure contains a
> definitive record of customers, application performance, security
> threats, fraudulent activity and more. Splunk takes this data and makes
> sense of it. Business sense. IT sense. Common sense.
> http://p.sf.net/sfu/splunk-d2dcopy1
>
> ------------------------------
>
> _______________________________________________
> Contiki-developers mailing list
> Contiki-d...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/contiki-developers
>
>
> End of Contiki-developers Digest, Vol 64, Issue 94
> **************************************************
printf("Some float value = %d/n", (int)(1000*floatVariabe));
--
Eduardo Montoya Marín
---------------------------------------
CEDINT - UPM
Campus de Montegancedo
28223 Pozuelo de Alarcón
Madrid - ESPAÑA
Tlf: +34 91 336 45 13
Fax: +34 91 336 45 01
http://www.cedint.upm.es
---------------------------------------
2011/9/20 Aborigines <kid...@mail.ustc.edu.cn>:
float f_num = 50.0*50.0*20.0;
How can I display this number. I try to printf with %d and casting the
f_num to (int) but I get -15530.
Any suggestions?
>This message has been scanned for viruses and
>dangerous content by MailScanner, and is
>believed to be clean.
However if I try to print the following float I get negative:
float f = 33000.0
printf(" %d \n", (int)f);
How I can display float numbers greater than 33000.0 using msp430-gcc?
This has nothing to do with msp430 but casting in C, integer-width and
how printf works (it it not Java!). You should grab a decent C-book (one
of the thicker ons) and read the chapter about casting, as it is likely
that you will run into problems at some other places, too.
Cheers
Morty
--
Dipl.-Ing. Moritz 'Morty' Struebe (Wissenschaftlicher Mitarbeiter)
Lehrstuhl für Informatik 4 (Verteilte Systeme und Betriebssysteme)
Friedrich-Alexander-Universität Erlangen-Nürnberg
Martensstr. 1
91058 Erlangen
Tel : +49 9131 85-25419
Fax : +49 9131 85-28732
eMail : str...@informatik.uni-erlangen.de
WWW : http://www4.informatik.uni-erlangen.de/~morty
float f_num = 33000.0;
printf("%d\n",(unsigned long int)f_num);
On 10/4/11 12:08 PM, "Moritz Struebe"
<Moritz....@informatik.uni-erlangen.de> wrote:
>--------------------------------------------------------------------------
>----
>All the data continuously generated in your IT infrastructure contains a
>definitive record of customers, application performance, security
>threats, fraudulent activity and more. Splunk takes this data and makes
>sense of it. Business sense. IT sense. Common sense.
>http://p.sf.net/sfu/splunk-d2dcopy1_______________________________________
>________
>Contiki-developers mailing list
>Contiki-d...@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/contiki-developers
------------------------------------------------------------------------------
Cheers
Morty
try 'man 3 printf' and have a look at the length modifier 'l' as well as
the conversion specifier 'u'.
Cheers, Matthias
If you need exponentiation or square roots it gets trickier; those can still
be done (and more efficiently) in integer arithmetic but you may need to
extract the isqrt routines from the library or you will end up with the
entire floating point library anyway.
-----Original Message-----
From: Marios Koutroullos
Sent: Tuesday, October 04, 2011 5:25 AM
To: Contiki developer mailing list
Subject: Re: [Contiki-developers] Including math.h in contiki
So copy the position from java to memory of node successfully. My problem
is that if I try to do some debugging at C side for the calculations I
can not understand anything because printing of floats is not working
correctly.
What is the best workaround?
>http://p.sf.net/sfu/splunk-d2dcopy1
>_______________________________________________
>Contiki-developers mailing list
>Contiki-d...@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/contiki-developers
>
>
>--------------------------------------------------------------------------
>----
>All the data continuously generated in your IT infrastructure contains a
>definitive record of customers, application performance, security
>threats, fraudulent activity and more. Splunk takes this data and makes
>sense of it. Business sense. IT sense. Common sense.