Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Converting decimals to binary

by fglock (Vicar)
on Nov 11, 2004 at 15:56 UTC ( [id://407080]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use Bit::Vector;
    
    ...
    $bits = frac_bin ( 0.5 );
    $bits = frac_bin ( 0.75 );
    $bits = frac_bin ( 1 / 3 );
    
  2. or download this
    input: 0.5
    binary fraction: 10000000000000000000000000000000
    input: 0.75
    binary fraction: 11000000000000000000000000000000
    input: 0.333333333333333
    binary fraction: 01010101010101010101010101010101
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-04-26 00:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found