Convert Binary to Float (and back)

Discussion in 'Ruby' started by Nebiru, Sep 16, 2006.

  1. Nebiru

    Nebiru Guest

    I've hacked together some rather ugly code to convert a Binary to a
    Float but was hoping there is a more elegant way using perhaps pack and
    unpack
     
    Nebiru, Sep 16, 2006
    #1
    1. Advertising

  2. Nebiru

    Trans Guest

    Nebiru wrote:
    > I've hacked together some rather ugly code to convert a Binary to a
    > Float but was hoping there is a more elegant way using perhaps pack and
    > unpack


    Look at

    ri Array#pack

    And play around with those options.

    T.
     
    Trans, Sep 16, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andy
    Replies:
    7
    Views:
    6,296
    Roedy Green
    May 10, 2004
  2. bd
    Replies:
    0
    Views:
    651
  3. music4
    Replies:
    4
    Views:
    1,322
    Lew Pitcher
    Sep 20, 2003
  4. Harlin Seritt
    Replies:
    29
    Views:
    1,198
    Paul Rubin
    Feb 24, 2007
  5. Carsten Fuchs
    Replies:
    45
    Views:
    1,610
    James Kanze
    Oct 8, 2009
Loading...

Share This Page