l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2002 Mar 14 09:33

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] help with signals and C
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] help with signals and C

On Thu, 14 Mar 2002, Peter Jay Salzman wrote:

> yeah, i read about this in jeff's 1st link.  i'm not really doing much
> integer stuff, so it wasn't an issue and i didn't check it.  interesting
> that integer divide by zero gets caught!

In the x86 architecture, integer division by zero generates software
interrupt 0; that makes it easy to catch the problem:


I'm not sure about how the x86 interfaces with the FPU, so I couldn't tell
you why it doesn't get caught.  However:

   - Floating point division by zero is a well defined behavior.  Such
     an instruction shouldn't kill the program by default.

   - Integer division by zero should (in general) kill the program by

   - Therefore floating point division by zero and integer division by
     zero can't have the same default handler.

> > I'm not sure what kind of errors your program would have if it's not
> > generating "inf" or "nan".
> example:
> temperature = 1.0
> trials          Energy per site
> 1,000          -2.000000
> 10,000         -1.998448
> 100,000        -1.997171
> 1,000,000      -1.997530
> 10,000,000     -1.997312           <-- very close
> 100,000,000   -14.163610           <-- very not correct

I have no idea what that means...  At a glance, it looks like a rounding
error to me...

> mark, did you mention arbitrary precision library?  just out of
> curiosity, what is it called?

I just mentioned it because there's one for Java so I figured there'd be
one for C and/or C++.  Doing a quick "The Big G" search yields GNU MP:



Mark K. Kim
PGP key available upon request.

vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
EDGE Tech Corp.
For donating some give-aways for our meetings.