# Re: unit testing with class and floats

**URL:** <https://www.ruby-forum.com/t/re-unit-testing-with-class-and-floats/146993>\
**Category:** Ruby\
**Created:** [August 27, 2008, 11:37am UTC](https://www.ruby-forum.com/t/re-unit-testing-with-class-and-floats/146993 "2008-08-27T11:37:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stickstone](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/6f9a4e/32.png) [@stickstone](https://www.ruby-forum.com/u/stickstone)\
**Post date:** [August 27, 2008, 11:37am UTC](https://www.ruby-forum.com/t/re-unit-testing-with-class-and-floats/146993/1 "2008-08-27T11:37:23Z")

</div>

> expected = simpleclass.new(105.234)
> 
> assert\_equal(expected, somefunction(blahblah))

Try: assert\_in\_delta(expected, somefunction(blahblah), 0.001)

(Two floats which look the same when printed may actually be slightly  
different, due to the inexact nature of the internal representation)
