Bug 41992

GemStone/S 64 Bit

3.3.9, 3.3.8, 3.3.7, 3.3.6, 3.3.5, 3.3.4, 3.3.3, 3.3.1, 3.3, 3.2.16, 3.2.15, 3.2.14, 3.2.13, 3.2.12, 3.2.11, 3.2.10, 3.2.9, 3.2.8.1, 3.2.8, 3.2.7, 3.2.6, 3.2.5, 3.2.4, 3.2.3, 3.2.2, 3.2.1, 3.2, 3.1.0.6, 3.1.0.5, 3.1.0.4, 3.1.0.3, 3.1.0.2, 3.1.0.1, 3.1, 3.0.1, 3.0, 2.4.8, 2.4.7, 2.4.6, 2.4.5.1, 2.4.5, 2.4.4.8, 2.4.4.7, 2.4.4.6, 2.4.4.5, 2.4.4x, 2.3.1.6, 2.3.1, 2.2.5.4, 2.2.x, 2.x, 2.4x, 1.x

Linux only

SmallDouble literals and conversion from String slight rounding inaccuracy on Linux

Rounding of floating point values, per IEEE spec 754, rounds toward even.

The value exactly between 1.0 and its SmallDouble successor is precisely
    h = 1.00000000000000011102230246251565404236316680908203125

This value rounds to 1.0.

A value slightly larger than h should round to 1.0000000000000002.

However, given a value slightly larger than h, such as
    s = 1.000000000000000111023

On Linux versions with glibc earlier than 2.17, the SmallDouble created from s is incorrectly 1.0, rather than the correct result which is 1.0000000000000002.

The GemStone internal code that creates SmallDoubles from literals or String conversion uses the OS function strtod(). Linux kernels have a bug in this code: https://sourceware.org/bugzilla/show_bug.cgi?id=3479.

Workaround

This Linux bug is fixed in glibc v2.17.


Last updated: 4/7/15