Re: Working with floating point values
- From: "David Veeneman" <davidv@xxxxxxxxxx>
- Date: Tue, 9 Aug 2005 10:01:27 -0500
That's what I've always done in the past, but decimals are *much* slower to
process than floating-points. In this project, I'm running some fairly
complex calculations thousands of times each, so the difference between
decimals and doubles is quite noticeable. So, I'm pretty much stuck with
doubles.
"Brian Delahunty" <BrianDelahunty@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
message news:FA9D9644-D546-455B-8FD3-225951914CE3@xxxxxxxxxxxxxxxx
> Just use Decimal.
> --
> Brian Delahunty
> Ireland
>
> http://briandela.com/blog
>
>
> "David Veeneman" wrote:
>
>> I'm working on a project that uses floating-point values (doubles), and
>> I'm
>> being driven crazy by something pretty basic. I understand that it's in
>> the
>> nature of floating-point calculations to produce values like
>> 0.10000000000000003, when what I really want is 0.1. But is there any way
>> to
>> eliminate that digit at the end? I've tried rounding, but that simply
>> moves
>> the digit to the least significant position, such as 0.1000003.
>>
>> Failing that, can anyone recommend any good online articles for dealing
>> with
>> floating-point issues, beyond using Epsilon for zero comparisons? Thanks
>> in
>> advance.
>>
>> David Veeneman
>> Foresight Systems
>>
>>
>>
.
- References:
- Working with floating point values
- From: David Veeneman
- RE: Working with floating point values
- From: Brian Delahunty
- Working with floating point values
- Prev by Date: Re: Get the local path from an IIS Path
- Next by Date: Re: Working with floating point values
- Previous by thread: RE: Working with floating point values
- Next by thread: Re: Working with floating point values
- Index(es):
Relevant Pages
|