Thanks John.
Using modf() (instead of my code) was advocated by Salem in this thread:...
Type: Posts; User: bitslip
Thanks John.
Using modf() (instead of my code) was advocated by Salem in this thread:...
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 ) ;...
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....
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:...
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...
Oh, sorry.
I missed John's reply.
I'll try that!
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...
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...
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...
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
Thanks!
It worked.
Can you please point out what where the problem with how I wrote the code ?
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...