Re: Current implementation of exp() is faulty.

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

If you are testing for exact equality, why use atom_to_float64 at all? You are
still getting parsing errors when you do.

Have you tried using Matt's scientific.e library? I think that has a more
accurate parser.

A better solution would be to use C or Python to get your expected values and
store them in a file. The actual value, not a string representation. And then the
unit test would open that file and compare the Euphoria output to the contents of
the file.

Or your C/Python test harness could do the equivalent of atom_to_float64() and
store the byte values as a readable Euphoria sequence and then you could compare
that or cut/paste the values directly into your unit test.

But when you do "?atom_to_float64
(485165195.40979027796910683054154055868463898894484725435361080031597799614270974016
5979850652747349447833789438961)" in your source code, you will get precision
errors due to the limitations of the parser. It becomes an apples and oranges
comparison instead of apples and apples.

--
A complex system that works is invariably found to have evolved from a simple
system that works.
--John Gall's 15th law of Systemantics.

"Premature optimization is the root of all evil in programming."
--C.A.R. Hoare

j.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu