| Hi,
I am working on the NeXTstep version of 3.47, and intend to submit
the changes to the maintainers for inclusion in 3.48.
I am working on a NeXTstep-running P133, and have found some very
annoying floating point errors. I wonder if anyone else, on any
other platform, has successfully tackled this sort of problem.
I have also tried out experiments with IRIX 5.2, 6.2, and also with
a more recent version of gcc on NS3.3.
ALL of the platforms above suffer the same problem!
I discovered the problem when trying to compile a score and
orchestra with the following kr, sr, ksmps, resulting in the
following error:
sr = 22050.000000, kr = 1000.000000, ksmps = 22.049999
error: inconsistent sr, kr, ksmps
Of course, I had tried to use ksmps as 22.05.
At first I thought it was the sscanf in otran.c (constndx) that was
playing up, but then I experimented with some code fragments only
to find that even if I assigned "(float) newval = 22.05", "if
(newval == 22.05)" would fail.
Now I realise that floating point data is not perfect, but this is
ridiculous.
Is this something that can be fixed/worked around, or do we all
just grit our teeth and try to avoid certain numbers?
Cheers,
Stephen Brandon
---
Systems Administrator,
Department of Music, e-mail: S.Brandon@music.gla.ac.uk
14 University Gardens, (NeXT mail welcomed)
University of Glasgow, Tel: +44 (0)141 330 6065
Glasgow. Fax: +44 (0)141 330 3518
Scotland
G12 8QH |