This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug manual/14450] timeval_subtract example is erroneous


http://sourceware.org/bugzilla/show_bug.cgi?id=14450

Siddhesh Poyarekar <siddhesh at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |siddhesh at redhat dot com
         Resolution|                            |INVALID

--- Comment #2 from Siddhesh Poyarekar <siddhesh at redhat dot com> 2012-12-11 03:11:17 UTC ---
Not really.  timeval is not simply tv_sec.tv_usec.  It is tv_sec + tv_usec /
1000000.  They have different semantics when tv_sec is negative.  So you read:

{-10, 999999}

as

-10 + 999999/1000000 = -9.000001

and not

-10.999999

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]