Re: Test should pass? SunOS

new topic     » goto parent     » topic index » view thread      » older message » newer message

I just wanted to suggest that perhaps a more sensible test might be:

test_true( "Avagadro #1", abs(6.022141 * power(10,23) - scientific_to_atom("6.022141e23"))<1e8 ) 

aside: 1e8 might look like a massive error margin, but of course it is tiny relative to 1e23 (and in fact one millionth of one millionth of 0.1%).

Pete

EDIT: I now realize it may be impossible to replicate the precise floating point rounding modes on a completely different chip.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu