Article View: borland.public.jbuilder.java.language
Article #723Divide by zero using NumberFormat.getInstance().format(0.0)
From: Richard Ulrich
Date: Tue, 07 Dec 2004 02:50
Date: Tue, 07 Dec 2004 02:50
19 lines
1515 bytes
1515 bytes
Hello,
I'm getting the error "Unexpected Signal : EXCEPTION_FLT_DIVIDE_BY_ZERO
(0xc000008e) occurred at PC=0xA4CB08" on the last line of the following
block (which is adapted from my code):
double dexp = 0.0;
int DecimalDigits = 0; //these first two are actually inputs
to a function
NumberFormat nf = NumberFormat.getInstance();
nf.setMinimumFractionDigits(DecimalDigits);
nf.setMaximumFractionDigits(DecimalDigits);
nf.setGroupingUsed(false);
String str = nf.format(dexp); //BAM!
Am I doing something wrong?
Thanks,
Richard U.
Technical Details
Message-ID:
<41b51a6c$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!in.100proofnews.com!in.100proofnews.com!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: f74b3,b31ba3124d5e059f,start X-Google-Attributes: gidf74b3,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Richard Ulrich" <rm_ulrich@hotmail.com> Newsgroups: borland.public.jbuilder.java.language Subject: Divide by zero using NumberFormat.getInstance().format(0.0) Date: Mon, 6 Dec 2004 21:50:32 -0500 Lines: 21 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 NNTP-Posting-Host: 12.101.9.226 Message-ID: <41b51a6c$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1102387820 12.101.9.226 (6 Dec 2004 18:50:20 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!in.100proofnews.com!in.100proofnews.com!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail