security/nss/lib/freebl/mpi/make-logtab

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rwxr-xr-x

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 #!/usr/bin/perl
     3 #
     4 # make-logtab
     5 #
     6 # Generate a table of logarithms of 2 in various bases, for use in
     7 # estimating the output sizes of various bases.
     9 # This Source Code Form is subject to the terms of the Mozilla Public
    10 # License, v. 2.0. If a copy of the MPL was not distributed with this
    11 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
    13 $ARRAYNAME = $ENV{'ARRAYNAME'} || "s_logv_2";
    14 $ARRAYTYPE = $ENV{'ARRAYTYPE'} || "float";
    16 printf("const %s %s[] = {\n   %0.9ff, %0.9ff, ", 
    17        $ARRAYTYPE, $ARRAYNAME, 0, 0);
    18 $brk = 2;
    19 for($ix = 2; $ix < 64; $ix++) {
    20     printf("%0.9ff, ", (log(2)/log($ix)));
    21     $brk = ($brk + 1) & 3;
    22     if(!$brk) {
    23 	printf(" /* %2d %2d %2d %2d */\n   ",
    24 	       $ix - 3, $ix - 2, $ix - 1, $ix);
    25     }
    26 }
    27 printf("%0.9ff\n};\n\n", (log(2)/log($ix)));
    29 exit 0;

mercurial