🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #1762

Turbo C matherr() function

#1762
From: Bernie Roehl
Date: Wed, 01 Aug 1990 12:53
23 lines
1159 bytes
The problem is simple... maybe the solution will be, too.
I'm trying to define my own matherr() function, as described on page 242 of
the Reference Guide.

#include <math.h>

int matherr(struct exception *e)
	{
	fprintf(stderr, "Hello, world!\n");
	return 1;
	}

I then write a short program that just divides by zero, link it with the above,
and run it.  Instead of "Hello, world!\n", I get the standard Turboc C
"Floating point error: Divide by 0".

Any ideas/suggestions/etc will be much appreciated.  Thanks in advance...

-- 
	Bernie Roehl, University of Waterloo Electrical Engineering Dept
	Mail: broehl@watserv1.waterloo.edu OR broehl@watserv1.UWaterloo.ca
	BangPath: {allegra,decvax,utzoo,clyde}!watmath!watserv1!broehl
	Voice:  (519) 885-1211 x 2607 [work]
Technical Details
Message-ID: <1990Aug1.125327.26101@watserv1.waterloo.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!att!watmath!watserv1!broehl

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!att!watmath!watserv1!broehl
From: broehl@watserv1.waterloo.edu (Bernie Roehl)
Newsgroups: comp.os.msdos.programmer
Subject: Turbo C matherr() function
Message-ID: <1990Aug1.125327.26101@watserv1.waterloo.edu>
Date: 1 Aug 90 12:53:27 GMT
Distribution: comp
Organization: University of Waterloo
Lines: 23