From: RAM_LOCK <Kaushik.Sarkar@netapp.com>
To: linux-c-programming@vger.kernel.org
Subject: how compiler decide the range of real numbers in C...
Date: Thu, 30 Jul 2009 10:33:25 -0700 (PDT) [thread overview]
Message-ID: <24743191.post@talk.nabble.com> (raw)
Say 16 bit compiler (for ex Turbo C) uses 2's compliment to find the range of
signed integer.
Say for 16 bit n=16. Now applying 2's compliment equation : -2^(n-1) to
2^(n-1) -1
so for n=16 : The range is -32768 to 32767
This is ok. The question arises when it tell about real constant's range.
For 16 bit compiler the range of real constant is : -3.4e38 to 3.4e38
How they arrived to this real constant range?
Can any one share the mathematical calculation behind it?
thnx,
RAM_LOCK
--
View this message in context: http://www.nabble.com/how-compiler-decide-the-range-of-real-numbers-in-C...-tp24743191p24743191.html
Sent from the linux-c-programming mailing list archive at Nabble.com.
next reply other threads:[~2009-07-30 17:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-30 17:33 RAM_LOCK [this message]
2009-07-30 17:46 ` how compiler decide the range of real numbers in C Glynn Clements
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=24743191.post@talk.nabble.com \
--to=kaushik.sarkar@netapp.com \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.