CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: John E

Search: Search took 0.74 seconds.

  1. Thread: double vs int64

    by John E
    Replies
    14
    Views
    24,882

    Re: double vs int64

    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.
    ...
  2. Thread: double vs int64

    by John E
    Replies
    14
    Views
    24,882

    Re: double vs int64

    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...
  3. Thread: double vs int64

    by John E
    Replies
    14
    Views
    24,882

    Re: double vs int64

    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...
  4. Thread: double vs int64

    by John E
    Replies
    14
    Views
    24,882

    Re: double vs int64

    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...
  5. Thread: double vs int64

    by John E
    Replies
    14
    Views
    24,882

    Re: double vs int64

    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...
  6. Thread: double vs int64

    by John E
    Replies
    14
    Views
    24,882

    double vs int64

    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)...
Results 1 to 6 of 6





Click Here to Expand Forum to Full Width

Featured