Issue Details (XML | Word | Printable)

Key: STDCXX-51
Type: Improvement Improvement
Status: Reopened Reopened
Priority: Minor Minor
Assignee: Martin Sebor
Reporter: Martin Sebor
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
C++ Standard Library

infinity, NaN formatted differently on different platforms

Created: 15/Oct/05 07:49 AM   Updated: 27/May/08 03:31 PM
Return to search
Component/s: 22. Localization
Affects Version/s: 4.1.2, 4.1.3, 4.1.4, 4.2.0, 4.2.1
Fix Version/s: 4.2.2

Time Tracking:
Original Estimate: 13h
Original Estimate - 13h
Remaining Estimate: 8h
Time Spent - 13h Remaining Estimate - 8h
Time Spent: 13h
Time Spent - 13h Remaining Estimate - 8h

File Attachments:
  Size
File Licensed for inclusion in ASF works num_put.diff 2008-04-01 06:58 PM Farid Zaripov 10 kB
Environment: all
Issue Links:
Dependants
 
Reference
 

Patch Info: Patch Available
Severity: Incorrect Behavior


 Description  « Hide
The output of the program below is different depending on the operating system it runs on. It should be the same (preferably like that on AIX).
$ cat u.cpp && uname -sr && make u -r && ./u
#include <iostream>
#include <limits>

int main ()
{
    std::cout << std::numeric_limits<double>::infinity () << '\n'
              << std::numeric_limits<double>::quiet_NaN () << '\n'
              << std::numeric_limits<double>::signaling_NaN () << '\n'; 
}
SunOS 5.9
gcc -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG   -pthreads -D_RWSTD_USE_CONFIG -I/build/sebor/gcc-3.4.3-15s/include -I/build/sebor/dev/stdlib/include -I/build/sebor/dev/stdlib/examples/include  -pedantic -nostdinc++ -g  -Wall -W -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long  u.cpp
gcc u.o -o u -pthreads -L/build/sebor/gcc-3.4.3-15s/lib -lstd15s  -lsupc++ -lm
rm u.o
inf
nan
nan

$ uname -vs && gmake u -r && ./u
AIX 5
xlCcore_r -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG    -D_RWSTD_USE_CONFIG -I/build/sebor/vacpp-7.0.0.3-15D/include -I/build/sebor/dev/stdlib/include -I/build/sebor/dev/stdlib/examples/include  -g  -q64  -qtemplateregistry=u.ti   u.cpp
xlCcore_r u.o -o u -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG    -D_RWSTD_USE_CONFIG -liconv -brtl   -q64 -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG    -D_RWSTD_USE_CONFIG -I/build/sebor/vacpp-7.0.0.3-15D/include -I/build/sebor/dev/stdlib/include -I/build/sebor/dev/stdlib/examples/include  -qtemplateregistry=u.ti -L/build/sebor/vacpp-7.0.0.3-15D/lib -lstd15D   -lm
rm u.o
inf
nanq
nans


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Farid Zaripov logged work - 02/Apr/08 03:12 PM
Time Worked: 13h
Investigated the presence of the functions to detect inf and nan values on different platforms and compilers.
Created and tested patch on MSVC, gcc/Linux.