[Boost-users] isinf & Boost

12 views
Skip to first unread message

metty

unread,
Jan 26, 2008, 6:04:18 PM1/26/08
to boost...@lists.boost.org
Hi All,

I have to use isinf in an application. The application
was originally written using gcc (under linux) which
supports isinf. I want to port it to Windows and VC++
doesn't seem to support it. I googled around and I
think the "omnipotent" Boost has something to help
with this. Unfortunately, I couldn't get the details
of how to make use of it. I would be grateful if
someone can help me?

Thank you in advance!

metty


____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

_______________________________________________
Boost-users mailing list
Boost...@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users

Pete Bartlett

unread,
Jan 26, 2008, 6:25:04 PM1/26/08
to boost...@lists.boost.org

>Hi All,
>
>I have to use isinf in an application. The application
>was originally written using gcc (under linux) which
>supports isinf. I want to port it to Windows and VC++
>doesn't seem to support it. I googled around and I
>think the "omnipotent" Boost has something to help
>with this. Unfortunately, I couldn't get the details
>of how to make use of it. I would be grateful if
>someone can help me?
>
>Thank you in advance!
>
>metty
>

Try either John Maddock's Math Toolkit library or Johan Rade's floating
point utilities library. Both available from:

http://www.boost-consulting.com/vault/index.php?direction=0&order=&directory
=Math%20-%20Numerics

I believe the Math Toolkit will be in Boost 1.35 but recall finding both
libraries easy to lay over the top of 1.34. In John's library you need

Math_toolkit_headers.zip / boost / math / special_functions / fpclassify.hpp
/ bool template<typename T> isinf(T t);

I believe Johan's implementation is even more portable and robust than
John's, but perhaps less far through the review process:

Floating_point_utilities_v3.zip / boost / math / fpclassify.hpp / bool
template<typename T> isinf(T t);

Hth,
Pete

John Maddock

unread,
Jan 27, 2008, 7:29:30 AM1/27/08
to boost...@lists.boost.org
Pete Bartlett wrote:
> I believe the Math Toolkit will be in Boost 1.35

Correct.

> I believe Johan's implementation is even more portable and robust than
> John's, but perhaps less far through the review process:

Well, I'm biased :-) But I'd characterise it like this: the version that
will be in Boost-1.35 uses only portable C++ code, and will forward to the
platforms native version if there is one. It's also been tested on all the
platforms we regression test on, and the only failure I know of turned out
to be a bug in numeric_limits (confirmed by IBM). On the other hand,
Johan's implementation peeks at the bits of the value to determine it's
type, which is *much* faster for native floating point types, but *maybe*
less portable for some platforms, and doesn't scale to user defined floating
point types. Hopefully we'll end up with a combination of the best bits of
the two versions in the end - and Johan's code review is coming up at the
end of Feb if you're interested BTW.

HTH, John.

Johan Råde

unread,
Jan 27, 2008, 9:58:51 AM1/27/08
to boost...@lists.boost.org
John Maddock wrote:
>
> Well, I'm biased :-) But I'd characterise it like this: the version that
> will be in Boost-1.35 uses only portable C++ code, and will forward to the
> platforms native version if there is one. It's also been tested on all the
> platforms we regression test on, and the only failure I know of turned out
> to be a bug in numeric_limits (confirmed by IBM). On the other hand,
> Johan's implementation peeks at the bits of the value to determine it's
> type, which is *much* faster for native floating point types, but *maybe*
> less portable for some platforms, and doesn't scale to user defined floating
> point types. Hopefully we'll end up with a combination of the best bits of
> the two versions in the end - and Johan's code review is coming up at the
> end of Feb if you're interested BTW.
>
> HTH, John.

I fully agree with John's description.

--Johan

Pete Bartlett

unread,
Jan 27, 2008, 2:06:02 PM1/27/08
to boost...@lists.boost.org
John Maddock wrote:
> Pete Bartlett wrote:
> > I believe Johan's implementation is even more portable and robust than
> > John's, but perhaps less far through the review process:

> [..]I'd characterise it like this:
[explanation snipped]

Thanks John for the helpful explanation. Apologies for the
mis-characterization of the differences between the two libraries and their
approaches.

Pete

John Maddock

unread,
Jan 28, 2008, 4:29:14 AM1/28/08
to boost...@lists.boost.org
Pete Bartlett wrote:
> Thanks John for the helpful explanation. Apologies for the
> mis-characterization of the differences between the two libraries and
> their approaches.

No worries, John.

metty

unread,
Jan 29, 2008, 4:55:18 PM1/29/08
to boost...@lists.boost.org
Dear Pete Bartlett,

Sorry I am late to thank you. Your reply was helpful
and I could solve the problem using John Madock's Math
toolkit which seamlessly integrates with an older
version of Boost.

Thank you again.

Best regards,

metty

____________________________________________________________________________________


Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

_______________________________________________

Reply all
Reply to author
Forward
0 new messages