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