Re: Comparing structures, ignoring floating point roundoff differences
- From: Jim Gibson <jgibson@xxxxxxxxxxxxxxxxx>
- Date: Fri, 18 Nov 2005 12:39:24 -0800
In article <m3acg16agk.fsf@xxxxxxxxxxxxxxxxxxxxxx>, Joseph Brenner
<doom@xxxxxxxxxxxxxxxxx> wrote:
> I've got a problem where I need to compare structures that have
> floating point numbers stashed in them. I want to test the
> structures for identity (ala is_deeply from Test::More), but
> ignore tiny differences in the floating point numbers.
>
> This seems like something that ought to be a solved problem by
> now, but I'm having trouble finding it. I had some hopes for
> Test::Deep, which at least has a "num" comparison operation where
> you can set a tolerance to ignore, but it looks to me like that's
> only for comparing a computed value to an expected constant
> value: I need to compare computed values that are expected to
> match each other.
>
> Does that ring any bells with anyone?
The module Test::Number::Delta allows you to compare two floating-point
values within a specified precision.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
.
- References:
- Comparing structures, ignoring floating point roundoff differences
- From: Joseph Brenner
- Comparing structures, ignoring floating point roundoff differences
- Prev by Date: Re: Question regarding databases..
- Next by Date: XML Parsing too slow
- Previous by thread: Comparing structures, ignoring floating point roundoff differences
- Next by thread: XML Parsing too slow
- Index(es):
Relevant Pages
|
|