stdcxx-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Sebor (JIRA)" <j...@apache.org>
Subject [jira] Commented: (STDCXX-51) infinity, NaN formatted differently on different platforms
Date Wed, 02 Apr 2008 17:15:25 GMT

    [ https://issues.apache.org/jira/browse/STDCXX-51?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12584675#action_12584675
] 

Martin Sebor commented on STDCXX-51:
------------------------------------

I think this is the right approach. At some point we will probably want to move these functions
into their own platform-specific header (analogous to the {{_config-*.h}} headers and to what
you're doing with {{_atomic.h}}).

A few suggestions regarding names:

# I think we might want to change {{\_\_rw_isinfnan}} to {{\_\_rw_isfinite}} for consistency
with C99.
# Similarly, I suggest to replace the {{\_\_rw_isneginf}}, {{\_\_rw_isposinf}}, {{\_\_rw_isnegnan}}
and {{\_\_rw_isposnan}} functions with {{\_\_rw_signbit}} and their uses with, for example
{{\_\_rw_isinf\(x) && 0 > \_\_rw_signbit\(x)}}. Besides the names being consistent
with C99 breaking them up like this should also make {{\_\_rw_fmat_infnan}} slightly more
efficient in that the function won't need to be testing for the special values repeatedly.
# Lastly, in the same vein as (1), I would suggest to rename {{\_\_rw_fmat_infnan}} to {{\_\_rw_fmat_infinite}}
since _infinite_ (i.e., {{!isfinite\(x)}}) implies that {{x}} is either an Infinity or NaN.


> infinity, NaN formatted differently on different platforms
> ----------------------------------------------------------
>
>                 Key: STDCXX-51
>                 URL: https://issues.apache.org/jira/browse/STDCXX-51
>             Project: C++ Standard Library
>          Issue Type: Improvement
>          Components: 22. Localization
>    Affects Versions: 4.1.2, 4.1.3, 4.1.4, 4.2.0
>         Environment: all
>            Reporter: Martin Sebor
>            Assignee: Farid Zaripov
>            Priority: Minor
>             Fix For: 4.2.1
>
>         Attachments: num_put.diff
>
>   Original Estimate: 13h
>          Time Spent: 13h
>  Remaining Estimate: 0h
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message