Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
5f2db274
Kaydet (Commit)
5f2db274
authored
Eki 24, 2015
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
implement proper Inf and NaN handling in rtl_math_erf() and rtl_math_erfc()
Change-Id: Ib96d7123a3c483e9a1c78666bf042396510d733f
üst
0d4f4223
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
math.cxx
sal/rtl/math.cxx
+22
-0
No files found.
sal/rtl/math.cxx
Dosyayı görüntüle @
5f2db274
...
@@ -1143,7 +1143,18 @@ double SAL_CALL rtl_math_erf( double x ) SAL_THROW_EXTERN_C()
...
@@ -1143,7 +1143,18 @@ double SAL_CALL rtl_math_erf( double x ) SAL_THROW_EXTERN_C()
// Otherwise we may end up in endless recursion through rtl_math_erfc().
// Otherwise we may end up in endless recursion through rtl_math_erfc().
if
(
!::
rtl
::
math
::
isFinite
(
x
))
if
(
!::
rtl
::
math
::
isFinite
(
x
))
{
// See http://en.cppreference.com/w/cpp/numeric/math/erf
if
(
::
rtl
::
math
::
isInf
(
x
))
{
if
(
::
rtl
::
math
::
isSignBitSet
(
x
))
return
-
1.0
;
else
return
1.0
;
}
// It is a NaN.
return
x
;
return
x
;
}
bool
bNegative
=
false
;
bool
bNegative
=
false
;
if
(
x
<
0.0
)
if
(
x
<
0.0
)
...
@@ -1183,7 +1194,18 @@ double SAL_CALL rtl_math_erfc( double x ) SAL_THROW_EXTERN_C()
...
@@ -1183,7 +1194,18 @@ double SAL_CALL rtl_math_erfc( double x ) SAL_THROW_EXTERN_C()
// Otherwise we may end up in endless recursion through rtl_math_erf().
// Otherwise we may end up in endless recursion through rtl_math_erf().
if
(
!::
rtl
::
math
::
isFinite
(
x
))
if
(
!::
rtl
::
math
::
isFinite
(
x
))
{
// See http://en.cppreference.com/w/cpp/numeric/math/erfc
if
(
::
rtl
::
math
::
isInf
(
x
))
{
if
(
::
rtl
::
math
::
isSignBitSet
(
x
))
return
2.0
;
else
return
0.0
;
}
// It is a NaN.
return
x
;
return
x
;
}
bool
bNegative
=
false
;
bool
bNegative
=
false
;
if
(
x
<
0.0
)
if
(
x
<
0.0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment