Float precision and FIT

E

Ed Howland

Hello,

I am trying to get the Division example on the FIT wiki=20
http://fit.c2.com/wiki.cgi?WhatAndHowTalk

to run under Ruby and the Fit framework. I have 2 questions. First I
get red results on last 3 tests because the precision in the HTML
table is only up to 8 digits, but Ruby is calculating 15 digits.

And second, even after I adjust the HTML to match the results, they
till don't equal. I am thinking this is because of '=3D=3D' vs. eql? on
floats.

Is there a way coerce a Ruby float to an aribitray precision via
truncate or round?

Thanks
 
J

Jeff Wood

------=_Part_34481_6375727.1133201809333
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Do you have a FIT fixture for running Ruby ?

j


Hello,

I am trying to get the Division example on the FIT wiki
http://fit.c2.com/wiki.cgi?WhatAndHowTalk

to run under Ruby and the Fit framework. I have 2 questions. First I
get red results on last 3 tests because the precision in the HTML
table is only up to 8 digits, but Ruby is calculating 15 digits.

And second, even after I adjust the HTML to match the results, they
till don't equal. I am thinking this is because of '=3D=3D' vs. eql? on
floats.

Is there a way coerce a Ruby float to an aribitray precision via
truncate or round?

Thanks


--
"Remember. Understand. Believe. Yield! -> http://ruby-lang.org"

Jeff Wood

------=_Part_34481_6375727.1133201809333--
 
J

Jeff Wood

------=_Part_34888_4089962.1133203490108
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Ah.

If I remember correctly, there once was rumor that Dave Thomas was working
on a FIT-like framework for Ruby ...

I wonder whatever happened to that project...

I've written a little ruby replacement of FIT ... I'll probably post it if
we don't find that someone else has already done the work.

Haven't taken the next step and built it into a wiki like the FITnesse
project ...

j.


Well, I have the Fit framwork d/l from the aforementioned Wiki. There
is apparently another
project in CVS on Rubyforge. Haven't checked it out yet.


Ed


--
"Remember. Understand. Believe. Yield! -> http://ruby-lang.org"

Jeff Wood

------=_Part_34888_4089962.1133203490108--
 
E

Ed Howland

Ah.

If I remember correctly, there once was rumor that Dave Thomas was workin= g
on a FIT-like framework for Ruby ...

I wonder whatever happened to that project...

I think that is the one I d/l from the wiki. Not sure though.
I've written a little ruby replacement of FIT ... I'll probably post it i= f
we don't find that someone else has already done the work.

Haven't taken the next step and built it into a wiki like the FITnesse
project ...

There is a version of RubyFIT in CVS on RubyForge. I tried it out and
it ran the Simple example (eg.Division) right out of the box. Solves
the precision problem by using a type adapter. Looking forward to how
that code addresses the 5 digit precision issue in Java v. Ruby.

So take a look at that one. If yours is better/different somehow, go
ahead and post it.

http://rubyforge.org/projects/fit

Ed
 
E

Eric Hodel

And second, even after I adjust the HTML to match the results, they
till don't equal. I am thinking this is because of '==' vs. eql? on
floats.

No. Float precision.
Is there a way coerce a Ruby float to an aribitray precision via
truncate or round?

For testing float equality do what Test::Unit's assert_in_delta does.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,778
Messages
2,569,605
Members
45,238
Latest member
Top CryptoPodcasts

Latest Threads

Top