aboutsummaryrefslogtreecommitdiffstats
path: root/trio/doc/doc_nan.h
blob: bfb3ffc942762294583cb0bc0ec7c271a851865a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*************************************************************************
 *
 * $Id: doc_nan.h,v 1.1 2001/12/30 12:47:41 breese Exp $
 *
 * Copyright (C) 2001 Bjorn Reese and Daniel Stenberg.
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
 * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
 * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
 *
 ************************************************************************/

/** @addtogroup SpecialQuantities Special Quantifies.
Functions to detect and fabricate special quantities in floating-point
numbers.

@b SYNOPSIS

@verbatim
cc ... -ltrio -lm

#include <trionan.h>
@endverbatim

@b DESCRIPTION

Certain arithmetical operations does not result in normal numbers. Instead
they result in special quantities that must be handled differently by the
floating-point hardware. These includes Infinity and Not-A-Number (NaN).

For example, 0/0 (zero divided by zero) yields NaN. Any operation which
involves a NaN will result in NaN. Any comparison involving NaN will be
unsuccessful, even if NaN is compared to NaN.

These special quantities are represented with special bit patterns by the
floating-point hardware, and this bit patterns depend on the hardware.
There may even be hardware that does not support special quantities, so
the functions in this module are not guaranteed to work on all platforms.

The approach used in this module is to (in decreasing order of importance)
@li Use C99 functionality when available.
@li Use IEEE 754-1985 bit patterns if possible.
@li Use platform-specific techniques.

@b NOTES

This module does not depend on the rest of trio, and can thus be reused
separately. The following files are necessary:
@li @c triodef.h
@li @c trionan.h
@li @c trionan.c

*/
.highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#!/usr/bin/env perl
#
# Make a fetchmail release.
# Dumps a release notice and diffs as a MIME multipart message 
# in RELEASE_NOTES
#
use POSIX qw(strftime);
$timezone = strftime('%z', localtime) || "-0500";
$tmp = $ENV{TMPDIR} || $ENV{TMP} || $ENV{TEMP} || "/tmp";

$project = "fetchmail";
$svnrepos = "https://decoy.wox.org/svn/$project";
$website = "http://developer.berlios.de/projects/$project";
$mailfrom = "<$project-devel-owner\@lists.berlios.de> (Fetchmail Development Team)";

# parse options
$diffs = 0;
$verbose = 0;
$null = ">/dev/null";
$errnull = "2>/dev/null";
while ($i = shift @ARGV)
{
	if ($i =~ /^(--diffs|-d)$/i)
	{
		$diffs = 1;
		next;
	}

	if ($i =~ /^(--verbose|-v)$/i)
	{
		$verbose = 1;
		$null = "";
		next;
	}

	die "Error: Unknown option: $i\n";
}

# extract version from source
$version=`grep 'AC_INIT' configure.ac`;
$version =~ /AC_INIT\([^,]*,\[?([0-9.rc-]+)\]?\)/;
$version = $1;
die "cannot determine version" unless defined $1;
$tag = "RELEASE_$version";
$tag =~ tr/./-/;

# extract existing tags
open(ID, "-|", "svn", "ls", $svnrepos . "/tags") || die "cannot run svn ls: $!\naborting";
while (<ID>) {
    if (m{^(RELEASE_.*)/}) {
	unshift(@versions, $1);
    }
}
close ID || die "svn ls  failed, aborting";

if ($versions[0] eq $tag) {
    $tag = $versions[0];
    $oldtag = $versions[1];
} else {
    $tag = '<workfile>';
    $oldtag = $versions[0];
}

$ENV{PATH} .= ":./dist-tools:./dist-tools/shipper:.";

print "Building $version release, tag $tag, previous tag $oldtag\n";

if (-d autom4te.cache) {
    system("rm -rf autom4te.cache")
	and die "Failure in removing autom4te.cache";
}

if (system("autoreconf -isv")) {
	die("Failure in regenerating autoconf files\n");
}

if (system("./configure && make clean && make -C po update-po && make clean")) {
	die("Failure in translation-file rebuild\n");
}

print "### Test-building the software...\n";
if (system("./configure && make clean && make distcheck")) {
	die("Compilation failure\n");
}

print "### Building the distribution...\n";
if (system("make dist $null")) {
	die("Distribution-build failure\n");
}

print "### Building the RPMs...\n";
if (system("buildrpms $project-${version}.tar.gz $null")) {
	die("RPM-build failure\n");
}

open(REPORT, ">$tmp/$project.PREAMBLE.$$");

print REPORT <<EOF;
From: $mailfrom
Subject: The $version release of $project is available

The $version release of $project is now available at the usual locations,
including <URL:$website>.

The source archive is available at:
<URL:$website/$project-${version}.tar.gz>

Here are the release notes:

EOF

# Extract the current notes
open(NEWS, "NEWS");
while (<NEWS>) {
    if (/^$project/) {
	print REPORT $_;
	last;
    }
}
while (<NEWS>) {
    if (/^$project/) {
	last;
    }
    print REPORT $_;
}

$oldver = $oldtag;
$oldver =~ tr/-/./;
$oldver =~ s/^RELEASE_//;

if ($diffs) {
	print REPORT "Diffs from the previous ($oldver) release follow as a MIME attachment."
} else {
        print REPORT "By popular demand, diffs from the previous release have been omitted."
}

close(NEWS);

close(REPORT);

if ($tag eq '<workfile>') {
    system("svn diff -r$oldtag        $errnull >$tmp/$project.DIFFS.$$");
} else {
    system("svn diff -r$oldtag -r$tag $errnull >$tmp/$project.DIFFS.$$");
}
print "Diff size:";
system("wc <$tmp/$project.DIFFS.$$");

if ($diffs) {
	system "metasend -b"
	    ." -D '$project-$tag announcement' -m 'text/plain' -e 7bit -f $tmp/$project.PREAMBLE.$$"
	    ." -n -D 'diff between $oldver and $version' -m 'text/plain' -e 7bit -f $tmp/$project.DIFFS.$$"
	    ." -o ANNOUNCE.EMAIL";
} else {
	rename("$tmp/$project.PREAMBLE.$$", "ANNOUNCE.EMAIL");
}
#system("chown esr ANNOUNCE.EMAIL");
#chmod(0700, "ANNOUNCE.EMAIL");

#unlink("$tmp/$project.PREAMBLE.$$");
unlink("$tmp/$project.DIFFS.$$");

print "Building index page...\n";
system("rm -f index.html; indexgen.sh");

if (-r "testsites") {
	print "Building test server list...\n";
	system("rm -f testservers.html; testservers-gen.sh >testservers.html");
}

print "Making activity graph...";
system "growthplot";

print "Done\n";

# makerelease ends here