Skip to content

Commit 7de46e5

Browse files
committed
variable-precision float operations behave non-deterministically
1 parent fcc06c8 commit 7de46e5

File tree

2 files changed

+116
-58
lines changed

2 files changed

+116
-58
lines changed

library/std/src/f32.rs

+58-29
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,8 @@ impl f32 {
373373
///
374374
/// # Platform-specific precision
375375
///
376-
/// The precision of this function varies by platform and Rust version.
376+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
377+
/// even can even differ within the same execution from one invocation to the next.
377378
///
378379
/// # Examples
379380
///
@@ -395,7 +396,8 @@ impl f32 {
395396
///
396397
/// # Platform-specific precision
397398
///
398-
/// The precision of this function varies by platform and Rust version.
399+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
400+
/// even can even differ within the same execution from one invocation to the next.
399401
///
400402
/// # Examples
401403
///
@@ -446,7 +448,8 @@ impl f32 {
446448
///
447449
/// # Platform-specific precision
448450
///
449-
/// The precision of this function varies by platform and Rust version.
451+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
452+
/// even can even differ within the same execution from one invocation to the next.
450453
///
451454
/// # Examples
452455
///
@@ -472,7 +475,8 @@ impl f32 {
472475
///
473476
/// # Platform-specific precision
474477
///
475-
/// The precision of this function varies by platform and Rust version.
478+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
479+
/// even can even differ within the same execution from one invocation to the next.
476480
///
477481
/// # Examples
478482
///
@@ -496,7 +500,8 @@ impl f32 {
496500
///
497501
/// # Platform-specific precision
498502
///
499-
/// The precision of this function varies by platform and Rust version.
503+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
504+
/// even can even differ within the same execution from one invocation to the next.
500505
///
501506
/// # Examples
502507
///
@@ -526,7 +531,8 @@ impl f32 {
526531
///
527532
/// # Platform-specific precision
528533
///
529-
/// The precision of this function varies by platform and Rust version.
534+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
535+
/// even can even differ within the same execution from one invocation to the next.
530536
///
531537
/// # Examples
532538
///
@@ -550,7 +556,8 @@ impl f32 {
550556
///
551557
/// # Platform-specific precision
552558
///
553-
/// The precision of this function varies by platform and Rust version.
559+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
560+
/// even can even differ within the same execution from one invocation to the next.
554561
///
555562
/// # Examples
556563
///
@@ -574,7 +581,8 @@ impl f32 {
574581
///
575582
/// # Platform-specific precision
576583
///
577-
/// The precision of this function varies by platform and Rust version.
584+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
585+
/// even can even differ within the same execution from one invocation to the next.
578586
///
579587
/// # Examples
580588
///
@@ -601,7 +609,8 @@ impl f32 {
601609
///
602610
/// # Platform-specific precision
603611
///
604-
/// The precision of this function varies by platform and Rust version.
612+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
613+
/// even can even differ within the same execution from one invocation to the next.
605614
/// This function currently corresponds to the `fdimf` from libc on Unix
606615
/// and Windows. Note that this might change in the future.
607616
///
@@ -639,7 +648,8 @@ impl f32 {
639648
///
640649
/// # Platform-specific precision
641650
///
642-
/// The precision of this function varies by platform and Rust version.
651+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
652+
/// even can even differ within the same execution from one invocation to the next.
643653
/// This function currently corresponds to the `cbrtf` from libc on Unix
644654
/// and Windows. Note that this might change in the future.
645655
///
@@ -668,7 +678,8 @@ impl f32 {
668678
///
669679
/// # Platform-specific precision
670680
///
671-
/// The precision of this function varies by platform and Rust version.
681+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
682+
/// even can even differ within the same execution from one invocation to the next.
672683
/// This function currently corresponds to the `hypotf` from libc on Unix
673684
/// and Windows. Note that this might change in the future.
674685
///
@@ -695,7 +706,8 @@ impl f32 {
695706
///
696707
/// # Platform-specific precision
697708
///
698-
/// The precision of this function varies by platform and Rust version.
709+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
710+
/// even can even differ within the same execution from one invocation to the next.
699711
///
700712
/// # Examples
701713
///
@@ -718,7 +730,8 @@ impl f32 {
718730
///
719731
/// # Platform-specific precision
720732
///
721-
/// The precision of this function varies by platform and Rust version.
733+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
734+
/// even can even differ within the same execution from one invocation to the next.
722735
///
723736
/// # Examples
724737
///
@@ -741,7 +754,8 @@ impl f32 {
741754
///
742755
/// # Platform-specific precision
743756
///
744-
/// The precision of this function varies by platform and Rust version.
757+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
758+
/// even can even differ within the same execution from one invocation to the next.
745759
/// This function currently corresponds to the `tanf` from libc on Unix and
746760
/// Windows. Note that this might change in the future.
747761
///
@@ -767,7 +781,8 @@ impl f32 {
767781
///
768782
/// # Platform-specific precision
769783
///
770-
/// The precision of this function varies by platform and Rust version.
784+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
785+
/// even can even differ within the same execution from one invocation to the next.
771786
/// This function currently corresponds to the `asinf` from libc on Unix
772787
/// and Windows. Note that this might change in the future.
773788
///
@@ -796,7 +811,8 @@ impl f32 {
796811
///
797812
/// # Platform-specific precision
798813
///
799-
/// The precision of this function varies by platform and Rust version.
814+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
815+
/// even can even differ within the same execution from one invocation to the next.
800816
/// This function currently corresponds to the `acosf` from libc on Unix
801817
/// and Windows. Note that this might change in the future.
802818
///
@@ -824,7 +840,8 @@ impl f32 {
824840
///
825841
/// # Platform-specific precision
826842
///
827-
/// The precision of this function varies by platform and Rust version.
843+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
844+
/// even can even differ within the same execution from one invocation to the next.
828845
/// This function currently corresponds to the `atanf` from libc on Unix
829846
/// and Windows. Note that this might change in the future.
830847
///
@@ -856,7 +873,8 @@ impl f32 {
856873
///
857874
/// # Platform-specific precision
858875
///
859-
/// The precision of this function varies by platform and Rust version.
876+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
877+
/// even can even differ within the same execution from one invocation to the next.
860878
/// This function currently corresponds to the `atan2f` from libc on Unix
861879
/// and Windows. Note that this might change in the future.
862880
///
@@ -892,7 +910,8 @@ impl f32 {
892910
///
893911
/// # Platform-specific precision
894912
///
895-
/// The precision of this function varies by platform and Rust version.
913+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
914+
/// even can even differ within the same execution from one invocation to the next.
896915
/// This function currently corresponds to the `(f32::sin(x),
897916
/// f32::cos(x))`. Note that this might change in the future.
898917
///
@@ -921,7 +940,8 @@ impl f32 {
921940
///
922941
/// # Platform-specific precision
923942
///
924-
/// The precision of this function varies by platform and Rust version.
943+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
944+
/// even can even differ within the same execution from one invocation to the next.
925945
/// This function currently corresponds to the `expm1f` from libc on Unix
926946
/// and Windows. Note that this might change in the future.
927947
///
@@ -949,7 +969,8 @@ impl f32 {
949969
///
950970
/// # Platform-specific precision
951971
///
952-
/// The precision of this function varies by platform and Rust version.
972+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
973+
/// even can even differ within the same execution from one invocation to the next.
953974
/// This function currently corresponds to the `log1pf` from libc on Unix
954975
/// and Windows. Note that this might change in the future.
955976
///
@@ -977,7 +998,8 @@ impl f32 {
977998
///
978999
/// # Platform-specific precision
9791000
///
980-
/// The precision of this function varies by platform and Rust version.
1001+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
1002+
/// even can even differ within the same execution from one invocation to the next.
9811003
/// This function currently corresponds to the `sinhf` from libc on Unix
9821004
/// and Windows. Note that this might change in the future.
9831005
///
@@ -1006,7 +1028,8 @@ impl f32 {
10061028
///
10071029
/// # Platform-specific precision
10081030
///
1009-
/// The precision of this function varies by platform and Rust version.
1031+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
1032+
/// even can even differ within the same execution from one invocation to the next.
10101033
/// This function currently corresponds to the `coshf` from libc on Unix
10111034
/// and Windows. Note that this might change in the future.
10121035
///
@@ -1035,7 +1058,8 @@ impl f32 {
10351058
///
10361059
/// # Platform-specific precision
10371060
///
1038-
/// The precision of this function varies by platform and Rust version.
1061+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
1062+
/// even can even differ within the same execution from one invocation to the next.
10391063
/// This function currently corresponds to the `tanhf` from libc on Unix
10401064
/// and Windows. Note that this might change in the future.
10411065
///
@@ -1064,7 +1088,8 @@ impl f32 {
10641088
///
10651089
/// # Platform-specific precision
10661090
///
1067-
/// The precision of this function varies by platform and Rust version.
1091+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
1092+
/// even can even differ within the same execution from one invocation to the next.
10681093
///
10691094
/// # Examples
10701095
///
@@ -1091,7 +1116,8 @@ impl f32 {
10911116
///
10921117
/// # Platform-specific precision
10931118
///
1094-
/// The precision of this function varies by platform and Rust version.
1119+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
1120+
/// even can even differ within the same execution from one invocation to the next.
10951121
///
10961122
/// # Examples
10971123
///
@@ -1120,7 +1146,8 @@ impl f32 {
11201146
///
11211147
/// # Platform-specific precision
11221148
///
1123-
/// The precision of this function varies by platform and Rust version.
1149+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
1150+
/// even can even differ within the same execution from one invocation to the next.
11241151
///
11251152
/// # Examples
11261153
///
@@ -1145,7 +1172,8 @@ impl f32 {
11451172
///
11461173
/// # Platform-specific precision
11471174
///
1148-
/// The precision of this function varies by platform and Rust version.
1175+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
1176+
/// even can even differ within the same execution from one invocation to the next.
11491177
/// This function currently corresponds to the `tgammaf` from libc on Unix
11501178
/// and Windows. Note that this might change in the future.
11511179
///
@@ -1173,7 +1201,8 @@ impl f32 {
11731201
///
11741202
/// # Platform-specific precision
11751203
///
1176-
/// The precision of this function varies by platform and Rust version.
1204+
/// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
1205+
/// even can even differ within the same execution from one invocation to the next.
11771206
/// This function currently corresponds to the `lgamma_r` from libc on Unix
11781207
/// and Windows. Note that this might change in the future.
11791208
///

0 commit comments

Comments
 (0)