All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: Antriksh Pany <antriksh.pany@gmail.com>
Cc: David Aguilar <davvid@gmail.com>,
	gitster@pobox.com, git@vger.kernel.org, markus.heidelberg@web.de,
	jnareb@gmail.com
Subject: Re: [PATCH v3 1/2] compat: add a mkstemps() compatibility function
Date: Tue, 02 Jun 2009 15:05:05 +0200	[thread overview]
Message-ID: <4A252381.9000103@viscovery.net> (raw)
In-Reply-To: <e6cd6cf90906020535m24d588eau40b800555c9e906f@mail.gmail.com>

Antriksh Pany schrieb:
> 2. tv_usec has a decimal value range of 0-999999  (10^6 usec make 1
> sec). Which means that tv_usec fits completely in 20 bits (or less).
> (tv_usec << 16) yields a number that fits completely in 36 bits (or
> less). Max value of this number is 999999 * 2^16, or for convenience,
> about M = 10^6 * 2^16. This number (in the range of 0 to M) goes on to
> be divided by D=62^6. Also, M > D. Thus, there is about a  D / M * 100
> ~ 87 % probability of the division M / D working out to be zero. i.e,
> in 87% cases, the last division (v/= num_letters) will cause 'v' to
> become 0.

But this value (after the 6th division, mind you) is not used. v is used
the last time after the 5th division; at this time it still carries enough
randomness: 62^5 < 2^32.

-- Hannes

  reply	other threads:[~2009-06-02 13:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-28  9:43 [PATCH v3 1/2] compat: add a mkstemps() compatibility function David Aguilar
2009-05-28  9:43 ` [PATCH v3 2/2] diff: generate prettier filenames when using GIT_EXTERNAL_DIFF David Aguilar
2009-06-02 12:35 ` [PATCH v3 1/2] compat: add a mkstemps() compatibility function Antriksh Pany
2009-06-02 13:05   ` Johannes Sixt [this message]
2009-06-03 15:59     ` Antriksh Pany
2009-06-03 23:33       ` David Aguilar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A252381.9000103@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=antriksh.pany@gmail.com \
    --cc=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jnareb@gmail.com \
    --cc=markus.heidelberg@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.