Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Sometimes TIME results produce negative values. Why?

negative results time values
0
Posted

Sometimes TIME results produce negative values. Why?

0

As an example, see the below output CL-USER(12): (time (fib 30)) ; cpu time (non-gc) 36,784 msec user, 140 msec system ; cpu time (gc) 3,994 msec user, 10 msec system ; cpu time (total) 40,778 msec user, 150 msec system ; real time 51,274 msec ; space allocation: ; 60,582,248 cons cells, -934,589,280 other bytes, 0 static bytes 1346269 CL-USER(13): The problem is with the overflow of machine integers. On 32-bit platforms, the allocator, which resides in low level C code, keeps track of counts using 32-bit variables. As these allocations occur over time, these variables can in fact overflow resulting in the negative output seen above. It would be a simple matter to adjust such values in the case where an overflow occurs only once (the typical case), by adding #x100000000 (4 GB) to the negative value. But because we cannot determine how many overflows actually occured, we choose not to adjust in all cases where negative space is reported as that would give wholly false (but apparently va

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123