Re: sorry .09 instead of .08
- From: Thomas Hawtin <usenet@xxxxxxxxxxxxxxxxx>
- Date: Mon, 30 Jan 2006 00:21:23 +0000
zero wrote:
BigDecimal will be slower though. If the values are all currency values, with only 2 numbers after the decimal point, ints are a good choice.
They are slower. However, is it going to make your program noticeably slower. Almost certainly not. Better to keep it safe than prematurely optimise.
Using ints is full of traps. No good for a billionaire companies, although longs should do for storage. Operations such as multiplication become tricky. Without treating it as a type in its own right, you can easily get into trouble.
Tom Hawtin -- Unemployed English Java programmer http://jroller.com/page/tackline/ .
- Follow-Ups:
- Re: sorry .09 instead of .08
- From: zero
- Re: sorry .09 instead of .08
- References:
- sorry .09 instead of .08
- From: joshdalrymple2000
- Re: sorry .09 instead of .08
- From: James Westby
- Re: sorry .09 instead of .08
- From: Thomas Hawtin
- Re: sorry .09 instead of .08
- From: zero
- sorry .09 instead of .08
- Prev by Date: Re: JAR file which needs to call another jar file....
- Next by Date: Re: JAR file which needs to call another jar file....
- Previous by thread: Re: sorry .09 instead of .08
- Next by thread: Re: sorry .09 instead of .08
- Index(es):
Relevant Pages
|