9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: hugo rivera <uair00@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: [9fans] plan 9 floating point representation
Date: Wed, 20 May 2009 11:49:51 +0200	[thread overview]
Message-ID: <138575260905200249u4a9b7baeyf27c6f3ead86a2@mail.gmail.com> (raw)

Hi,
I am learning a bit about floating point representation and I am
wondering about how plan 9 does this.
According to IEEE 754 (I think) the convention used by C for single
precision floating point numbers is to use 24 of the 32 bits available
for the significand and 8 bits for the exponent. It seems to me that
plan 9 follows this convention but I am still kind of puzzled about
the base of the exponent. I've been experimenting (on a 386) a while
and it looks like a base 4 to me, which is kind of strange, since I
was expecting a base 2 or 10. I think I got something wrong, but I
would appreciate if someone can explain this to me to have a better
idea of how this works. It looks to me that this stuff is very machine
dependent (or language?), is it?
The point of all this is to classify raw data (4 byte length)
according to their magnitude, I don't really care about the
significant. This is just an exercise for me, since there are other
easier ways to do it.

Saludos
--
Hugo



             reply	other threads:[~2009-05-20  9:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-20  9:49 hugo rivera [this message]
2009-05-20 10:46 Jonas Amoson
2009-05-20 12:38 ` hugo rivera

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=138575260905200249u4a9b7baeyf27c6f3ead86a2@mail.gmail.com \
    --to=uair00@gmail.com \
    --cc=9fans@9fans.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).