Article View: borland.public.jbuilder.java.language
Article #8770Re: JB4 and calcs on bigdecimal
From: icsd.jt
Date: Sat, 03 Mar 2001 07:44
Date: Sat, 03 Mar 2001 07:44
63 lines
3067 bytes
3067 bytes
Hello
I have remake some tests for my problem of call but without succes.
Our exchange being now a little old, I rest my question directly about
this forum and
A soon, Jacques
"Torsten Welches" <torsten.welches@who.cares.netcologne.de> a �crit dans le
message news: 3a8ceeb4$1_2@dnews...
>
> Jacques,
>
> while I'm not quite sure what you are after ("can'not pass F9"?)
> you might want to check the documentation on BigDecimal.
> BigDecimal provides (like the other math classes in java.math.*)
> methods to perform calculations, e.g. multiply two BigDecimals
> with bdResult = bd1.multiply(bd2) and so on.
>
> If you mix BigInteger and BigDecimal you would transform the
> BigInteger into a BigDecimal and apply the operation on that:
> BigInteger bi = ...
> BigDecimal bd = ...
> BigDecimal result = bd.multiply( newBigDecimal(bi) );
>
> If you mix primitive types (int, long double) with class types,
> e.g. double and BigInteger you would put the primitive into
> the appropriate wrapper class:
> double d = ...;
> BigDecimal bd = ...
> BigDecimal result = bd.multiply( new BigDecimal(d) );
>
> Torsten
>
> Generally you would handle different operand types by
> "upcasting the smaller" type to the "bigger" type, e.g. for
>
>
> <icsd.jt@wanadoo.fr> wrote:
> >Bonjour
> >j'essaie vainement de faire quelques op�rations math�matiques
> >simples sur des champs en bigdecimal (d�finis en create table par
> >numeric(9,2) par exemple)
> >La methode calcRow ( colonne1 * colonne 2 ) ne passe pas �
> >la compilation.
> >Quelqu'un pourrait-il me donner une methode pour y arriver ?
> >d'autre part, qu'elle est la ruse � utiliser, si elle existe, afin de
faire
> >ces m�mes calculs ( + - * / ) en m�langeant les types des op�randes
> >(bigdecimal,short et int)
> >Merci pour les tuyaux
> >Jacques
> >Hello
> >I try to make simple op�ration with bigdecimal in JB4.
> >the methode caclRow ( col1 def * col2 def ) can'not pass F9
> >Somebody can me say what method I must use.
> >Also, what is the way for make math operations with different
> >type of operand.
> >For advance Thank for help
> >Jacques
> >
> >
> >
> >
>
Technical Details
Message-ID:
<3aa09fd0$1_2@dnews>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!dnews!193.252.62.85References:
<3a8ce601_1@dnews> <3a8ceeb4$1_2@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f74b3,227670303e986775 X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-03-02 23:44:08 PST Reply-To: <icsd.jt@wanadoo.fr> From: <icsd.jt@wanadoo.fr> Newsgroups: borland.public.jbuilder.java.language References: <3a8ce601_1@dnews> <3a8ceeb4$1_2@dnews> Subject: Re: JB4 and calcs on bigdecimal Date: Sat, 3 Mar 2001 08:44:53 +0100 Lines: 65 Organization: ICSD - JaC X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 NNTP-Posting-Host: 193.252.62.85 Message-ID: <3aa09fd0$1_2@dnews> X-Trace: 2 Mar 2001 23:40:00 -0800, 193.252.62.85 Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!dnews!193.252.62.85