float: IEEE, big endian, little endian

Discussion in 'C++' started by Ernst Murnleitner, Jan 13, 2004.

  1. Dear readers,

    Maybe someone can help:

    I need to exchange data with a PLC. My computer (Linux on intel) uses the
    intel format (little endian), the other device uses the motorola format (big
    endian).

    So I have to change the order of the bytes for "int". But for "float":

    A) I do not know, if the order has also to be changed for float.

    B) As the float datatype can have any format, is there a function in the
    library to ensure, that I can get a 32bit IEEE floating point number?

    Greetings
    Ernst
    Ernst Murnleitner, Jan 13, 2004
    #1
    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. hicham
    Replies:
    2
    Views:
    9,009
    dxcoder
    Jul 2, 2003
  2. invincible

    Little Endian to Big Endian

    invincible, Jun 14, 2005, in forum: C++
    Replies:
    9
    Views:
    14,326
    Old Wolf
    Jun 14, 2005
  3. invincible
    Replies:
    1
    Views:
    537
    red floyd
    Jun 14, 2005
  4. hicham

    convert from big-endian to little-endian

    hicham, Jun 30, 2003, in forum: C Programming
    Replies:
    0
    Views:
    1,514
    hicham
    Jun 30, 2003
  5. Replies:
    5
    Views:
    335
    Stephen Sprunk
    Aug 31, 2006
Loading...

Share This Page