August 1st, 2013, 08:20 AM
Thanks again for that full explanation OReubens. I tried that assignment, like you suggested (double to int64_t) and you were absolutely right. The int64_t was 1 less than the original number.
...
July 31st, 2013, 10:00 AM
Presumably I was supposed to remove all the periods?
Interestingly, the compiler told me the number would get truncated from int64 to double. But according to the debugger it looked lie the right...
July 31st, 2013, 09:47 AM
Good suggestion, Thanks. :thumb:
I also realised that for 64-bit values on Linux, they should really be calling llabs(), rather than abs(). A convenience macro can then be used to map llabs() to...
July 31st, 2013, 05:24 AM
Hi Paul,
Yes, I understand about the inherent inaccuracies with float and double. Here's the problem I'm considering:-
void some_func(int64_t a, int64_t b)
{
printf ("%u\n", abs( a-b...
July 31st, 2013, 03:47 AM
Thanks guys. If I'm using my rusty old calculator correctly it looks like double has got a MUCH wider range than int64 - and even the humble float is almost comparable to int64. float seems to be...
July 31st, 2013, 01:32 AM
You'd think this would be a simple thing to find out from the internet but I must admit, I've struggled to find the answer :cry:
1) What is the range of numbers covered by a 64-bit double?
2)...