On Sep 29, 2008, at 2:02 AM, LehrerOffice - Jürg Räss wrote:
RB 2008r3.1 (and prior) return: 3.141593
RB 2008r4 returns: 3.14159265358979
The Language Reference says:
"Use the Format function when you want to convert numeric values
into formatted strings such as dates, times, currency, etc. For real
numbers, Str returns 7 significant digits."
Good hunting! You've clearly found either a bug in Str, or a failure
to document an intentional change. (Hopefully it's the former.)
- are both results 'correct'?
no: because the LR says so and it used to be like that? (-> bug)
That'd be my opinion.
yes: because with 15 significant digits, the double gets
represented more accurate in a string? (-> feature)
That's what you want, you could use the Variant->String conversion, or
use Format with a spec like "-0.#". But as you point out, if you want
a more "natural" representation with a reasonable number of
significant digits, it's harder to get that yourself.
- what influence might this different behavior have in various apps
(think of yours, too)...?
Probably not a lot, since Str with floats should mainly be used for
debugging (you'd normally use CStr for anything shown to the user).
Still, it makes debugging less pleasant.
- which behavior will the next release have?
Who can guess?
- what should i do regarding our 'reference files' (or more general:
doubles represented in a string)?
That's the tricky bit, isn't it?
Best,
- Joe
--
Joe Strout
Inspiring Applications, Inc.
http://www.InspiringApps.com
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|