Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: How to convert negative and positive floating points to binary and vice versa

by BrowserUk (Patriarch)
on Sep 20, 2014 at 11:42 UTC ( [id://1101371]=note: print w/replies, xml ) Need Help??


in reply to Re^2: How to convert negative and positive floating points to binary and vice versa
in thread How to convert negative and positive floating points to binary and vice versa

I would like to have an 8 bit negative/positive floating point.

You want an 8-bit floating point value. Why?

A floating point value consists of 3 parts:

  1. 1-bit to indicate the sign.
  2. A number of the remaining bits denote the scale of the value. (The exponent, characteristic or scale.)

    This scales the size of the value, and 1-bit indicates whether it is either bigger or smaller.

  3. A number of bits that represent the actual value. (The significand, coefficient or the mantissa.)

    These bits define the precision of the values tha can be represented.

Assuming that you go for 4 bits of precision, that leaves 3 bits for scaling, means you could represent numbers between +/- 0.001 and +/- 150, which is a pretty useless format.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re^3: How to convert negative and positive floating points to binary and vice versa

Replies are listed 'Best First'.
Re^4: How to convert negative and positive floating points to binary and vice versa
by thanos1983 (Parson) on Sep 21, 2014 at 02:35 UTC

    Hello BrowserUk,

    Thank you for your time and effort reading and replying to my question. Well I was planning to reach extreme timing accuracy but it does not make any sense. The number as you clearly pointed out will be extremely small with no point into it.

    At this point I should look for 32 bit positive and negative floating point conversions and stop thinking about such a small number since it will not result to anything useful, since the number will be so extremely small.

    Thank you, again for your time and effort reading and replying to my question.

    Seeking for Perl wisdom...on the process of learning...not there...yet!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1101371]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-16 05:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found