]> git.zerfleddert.de Git - micropolis/blame - src/tclx/src/tclxmerr.c
Import Micropolis from http://www.donhopkins.com/home/micropolis/
[micropolis] / src / tclx / src / tclxmerr.c
CommitLineData
6a5fa4e0
MG
1/*
2 * tclXmatherr.c --
3 *
4 * Extended Tcl default matherr routine, may be replace by an application
5 * specified version.
6 *-----------------------------------------------------------------------------
7 * Copyright 1992 Karl Lehenbauer and Mark Diekhans.
8 *
9 * Permission to use, copy, modify, and distribute this software and its
10 * documentation for any purpose and without fee is hereby granted, provided
11 * that the above copyright notice appear in all copies. Karl Lehenbauer and
12 * Mark Diekhans make no representations about the suitability of this
13 * software for any purpose. It is provided "as is" without express or
14 * implied warranty.
15 *-----------------------------------------------------------------------------
16 * $Id: tclXmatherr.c,v 2.1 1992/11/09 07:33:02 markd Exp $
17 *-----------------------------------------------------------------------------
18 */
19#include "tclxtend.h"
20
21#ifndef TCL_IEEE_FP_MATH
22
23#include <math.h>
24\f
25/*
26 *-----------------------------------------------------------------------------
27 *
28 * matherr --
29 * Default matherr routine for extended Tcl. If the error does not
30 * belong to Tcl, standard math error processing is done. An
31 * aplication may replace this routine with their own, however it must
32 * call \fBTcl_MathError\fR to check if the error belongs to tcl.
33 *
34 *-----------------------------------------------------------------------------
35 */
36int
37matherr (except)
38 struct exception *except;
39{
40 if (Tcl_MathError (except->name, except->type))
41 return 1;
42 else
43 return 0;
44}
45
46#else
47\f
48/*
49 *-----------------------------------------------------------------------------
50 *
51 * matherr --
52 * Dummy matherr for systems wanting to use IEEE 745-1985 floating point
53 * math error reporting. This just disables standard Unix matherr message
54 * printing by returning 1. Except parameter not specified, since some systems
55 * don't define it or even use matherr.
56 *
57 *-----------------------------------------------------------------------------
58 */
59int
60matherr ()
61{
62 return 1;
63}
64
65#endif /* TCL_IEEE_FP_MATH */
Impressum, Datenschutz