Search:

Type: Posts; User: bitslip

Search: Search took 0.00 seconds.

  1. Thread: Using modf()

    by bitslip
    Replies
    2
    Views
    3,618

    Thanks John. Using modf() (instead of my code)...

    Thanks John.
    Using modf() (instead of my code) was advocated by Salem in this thread:...
  2. Thread: Using modf()

    by bitslip
    Replies
    2
    Views
    3,618

    Using modf()

    Hello,


    I have a variable named: "number".
    My goal is to be left with only the fraction portion of "number".
    This is the code I wrote:



    float fraction_number = number - int ( number ) ;...
  3. Replies
    2
    Views
    4,958

    Thanks Salem, This is the line in...

    Thanks Salem,



    This is the line in question:

    double fraction_absolute_number = absolute_number - int ( absolute_number ) ; // Decrement the integer portion to be left only with the fraction....
  4. Replies
    10
    Views
    7,099

    So I completed the code and it seems to work fine...

    So I completed the code and it seems to work fine - at least with my very basic testing.
    I'd love to get some feedback on it.

    Please comment in this thread:...
  5. Replies
    2
    Views
    4,958

    double_to_fixed function and file IO

    Hello,

    Based on this thread :
    https://cboard.cprogramming.com/cplusplus-programming/179219-read-string-convert-write.html?posted=1

    I wrote the code below. It reads floating point numbers from...
  6. Replies
    10
    Views
    7,099

    Oh, sorry. I missed John's reply. I'll try that!

    Oh, sorry.
    I missed John's reply.
    I'll try that!
  7. Replies
    10
    Views
    7,099

    Thanks, So...I have the my function that's...

    Thanks,

    So...I have the my function that's called : "float_to_fixed".



    fixed_point_int = float_to_fixed ( converted_string_to_float )

    // "converted_string_to_float" is the float from the...
  8. Replies
    10
    Views
    7,099

    Sorry if I wasn't clear enough at first. I'll...

    Sorry if I wasn't clear enough at first. I'll explain again:
    Someone sends me a text file that contains strings representing floating point values (as shown in the first post).
    I need to convert...
  9. Replies
    10
    Views
    7,099

    Thanks for your input. But I don't quite...

    Thanks for your input. But I don't quite understand what you suggest to do.

    My function works on a floating point type numbers. So one way or another - I must convert the strings in the file...
  10. Replies
    10
    Views
    7,099

    Read string convert and write

    Hello,


    I have a file named "file_in.txt".
    This file has a list of real numbers - one number in evey line. For example:



    231
    -3442.14
  11. Replies
    3
    Views
    6,283

    Thanks! It worked. Can you please point out...

    Thanks!
    It worked.

    Can you please point out what where the problem with how I wrote the code ?
  12. Replies
    3
    Views
    6,283

    Copying every 4th byte

    Hello,

    I want to copy every 4th byte of file_1.bin into file_2.bin
    For example - if the contents of file_1.bin are :

    0x0 // Byte 1
    0x1 // Byte 2
    0x2 // Byte 3
    0xAB // Byte 4 Skip when...
Results 1 to 12 of 12