@@ -1226,6 +1226,7 @@ impl f128 {
1226
1226
#[ inline]
1227
1227
#[ rustc_allow_incoherent_impl]
1228
1228
#[ unstable( feature = "f128" , issue = "116909" ) ]
1229
+ // #[unstable(feature = "float_gamma", issue = "99842")]
1229
1230
#[ must_use = "method returns a new number and does not mutate the original value" ]
1230
1231
pub fn gamma ( self ) -> f128 {
1231
1232
unsafe { cmath:: tgammaf128 ( self ) }
@@ -1260,10 +1261,76 @@ impl f128 {
1260
1261
#[ inline]
1261
1262
#[ rustc_allow_incoherent_impl]
1262
1263
#[ unstable( feature = "f128" , issue = "116909" ) ]
1264
+ // #[unstable(feature = "float_gamma", issue = "99842")]
1263
1265
#[ must_use = "method returns a new number and does not mutate the original value" ]
1264
1266
pub fn ln_gamma ( self ) -> ( f128 , i32 ) {
1265
1267
let mut signgamp: i32 = 0 ;
1266
1268
let x = unsafe { cmath:: lgammaf128_r ( self , & mut signgamp) } ;
1267
1269
( x, signgamp)
1268
1270
}
1271
+
1272
+ /// Error function.
1273
+ ///
1274
+ /// # Unspecified precision
1275
+ ///
1276
+ /// The precision of this function is non-deterministic. This means it varies by platform,
1277
+ /// Rust version, and can even differ within the same execution from one invocation to the next.
1278
+ ///
1279
+ /// This function currently corresponds to the `erff128` from libc on Unix
1280
+ /// and Windows. Note that this might change in the future.
1281
+ ///
1282
+ /// # Examples
1283
+ ///
1284
+ /// ```
1285
+ /// #![feature(f128)]
1286
+ /// #![feature(float_erf)]
1287
+ /// # #[cfg(reliable_f128_math)] {
1288
+ /// let x: f128 = 1.0;
1289
+ ///
1290
+ /// let abs_difference = (x.erf() - 0.8427007929497148693412206350826093).abs();
1291
+ ///
1292
+ /// assert!(abs_difference <= f128::EPSILON);
1293
+ /// # }
1294
+ /// ```
1295
+ #[ rustc_allow_incoherent_impl]
1296
+ #[ must_use = "method returns a new number and does not mutate the original value" ]
1297
+ #[ unstable( feature = "f128" , issue = "116909" ) ]
1298
+ // #[unstable(feature = "float_erf", issue = "136321")]
1299
+ #[ inline]
1300
+ pub fn erf ( self ) -> f128 {
1301
+ unsafe { cmath:: erff128 ( self ) }
1302
+ }
1303
+
1304
+ /// Complementary error function.
1305
+ ///
1306
+ /// # Unspecified precision
1307
+ ///
1308
+ /// The precision of this function is non-deterministic. This means it varies by platform,
1309
+ /// Rust version, and can even differ within the same execution from one invocation to the next.
1310
+ ///
1311
+ /// This function currently corresponds to the `erfcf128` from libc on Unix
1312
+ /// and Windows. Note that this might change in the future.
1313
+ ///
1314
+ /// # Examples
1315
+ ///
1316
+ /// ```
1317
+ /// #![feature(f128)]
1318
+ /// #![feature(float_erf)]
1319
+ /// # #[cfg(reliable_f128_math)] {
1320
+ /// let x: f128 = 0.123;
1321
+ ///
1322
+ /// let one = x.erf() + x.erfc();
1323
+ /// let abs_difference = (one - 1.0).abs();
1324
+ ///
1325
+ /// assert!(abs_difference <= f128::EPSILON);
1326
+ /// # }
1327
+ /// ```
1328
+ #[ rustc_allow_incoherent_impl]
1329
+ #[ must_use = "method returns a new number and does not mutate the original value" ]
1330
+ #[ unstable( feature = "f128" , issue = "116909" ) ]
1331
+ // #[unstable(feature = "float_erf", issue = "136321")]
1332
+ #[ inline]
1333
+ pub fn erfc ( self ) -> f128 {
1334
+ unsafe { cmath:: erfcf128 ( self ) }
1335
+ }
1269
1336
}
0 commit comments