RE: QWORD (int64) question
- Posted by Matthew Lewis <matthewwalkerlewis at YAHOO.COM> Oct 28, 2002
- 501 views
> From: Elliott Sales de Andrade [mailto:quantum_analyst at hotmail.com] Sorry for the late reply (been out of town). > Alright, one last set of questions. These QWORD's will, most > probably, be > signed. So, I'll guess that instead of the line: > ret = peek4u({q_fptr_retval, 2}) > I'd need to put: > ret = {peek4u(q_fptr_retval), peek4s(q_fptr_retval + 4)} > to get {unsigned low dword, signed high dword}. > And, last question, how would i then put those two values > together, if I > needed to? I need to test for -1 values. Just multiplying the > high dword and > adding it to the low dword is good enough? Would that account for the > negative? Getting the hi word signed should work fine. Then you could just try: if hi_word < 0 then lo_word = -lo_word end if qword = lo_word + hi_word * #100000000 Of course, make sure that qword is an atom. If the numbers get too big, you will lose some precision (after 15 decimal digits). Matt Lewis