• Re: QWORD to double and vise-verse - checking overflow and loss of precision ?

    From R.Wieser@address@is.invalid to alt.lang.asm on Mon Jun 16 22:14:05 2025
    From Newsgroup: alt.lang.asm

    Rosario,

    if 64 number is a list of binary numbers, or 2 32 bits int
    numbers in memory, there is nothing that one miss

    The problem occurs when converting a (too big) 64-bit *float* into a 64-bit *integer*.

    if 64 bit number is ask as input, in decimal form (or something
    as long double 1.8968685675745464643;), yes some imprecision has
    to be in the last binary digits

    Thats also problem, but not as big as an the overflow described above.

    And than there is the loss-of-precision that can occur when a 64-bit
    *integer* is converted into a 64-bit *float*. If the integer has bits set above the 53-th bit than the float will not be able to exactly store that value (some of the integers lower bits will disappear).


    Though as my previous message mentions, I've been able to find that all of
    the above problems are caught caught and available in the FPU status word.

    Thanks for the reply though.

    Regards,
    Rudy Wieser


    --- Synchronet 3.21a-Linux NewsLink 1.2