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

So you want a floating-point number packed into 8 bits? Why?

I'm not sure if there is a standardized format for those, since they're not all too useful, I've only found them referenced in tutorials and university courses on floating-point numbers for students to practice on (e.g. http://sandbox.mc.edu/~bennet/cs110/textbook/module4_2.html or http://www.toves.org/books/float/#s2 ). Wikipedia has an article on Minifloats. Perl doesn't have a built-in conversion for that.

The smallest standardized IEEE format is 16 bits, and even those have their limitations.

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:25 UTC

    Hello Anonymous Monk,

    Thank you for your time and effort reading and replying to my question. At this point I assume that I made a mistake since it has been proven that even the smallest decimal number is up to 16 bits. Which is only used for extreme precision, not even for calculations reasons.

    I assume that my assumptions that I could get a floating point with 8 bits for even higher precision is useless.

    I think even 32 bits will do the work for my task.

    Thank you for your time and effort to help me with my question.

    Seeking for Perl wisdom...on the process of learning...not there...yet!
Re^4: How to convert negative and positive floating points to binary and vice versa
by thanos1983 (Parson) on Sep 21, 2014 at 02:26 UTC

    Hello Anonymous Monk,

    First of all I want to say thank you for your time and effort reading and replying to my question. Sorry for the late reply but I was out of network area.

    To be honest I wanted to experiment with binary number and try to build my library with all positive and negative variations of decimals.

    Based on the replies that I got from my question I suppose that 8 bit decimal integer will not result to something useful. So probably that small number does not even exist.

    Than I should reconsider this part and possibly work with 32 bit floating points (positive/negative) that possibly exist.

    Again thank you for your time and effort.

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