commit a2707cb6b3149323312bfcc9cc424f937ba854ff
parent f00b8af1a53c4a47dba9bb3efcf6a8e6266de371
Author: Bor Grošelj Simić <bor.groseljsimic@telemach.net>
Date: Fri, 30 Apr 2021 19:00:51 +0200
update stdlib with the new &&=, ||= and ^^= operators
Signed-off-by: Bor Grošelj Simić <bor.groseljsimic@telemach.net>
Diffstat:
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/strconv/ftos.ha b/strconv/ftos.ha
@@ -303,9 +303,8 @@ fn bintodec(mantissa: u64, exponent: u32) decf64 = {
const vmmod10 = (vm: u32) - 10 * (vmby10: u32);
const vrby10 = vr / 10;
const vrmod10 = (vr: u32) - 10 * (vrby10: u32);
- vm_trailing_zeros = vm_trailing_zeros && (vmmod10 == 0);
- vr_trailing_zeros = vr_trailing_zeros &&
- (last_removed_digit == 0);
+ vm_trailing_zeros &&= vmmod10 == 0;
+ vr_trailing_zeros &&= last_removed_digit == 0;
last_removed_digit = vrmod10: u8;
vr = vrby10; vp = vpby10; vm = vmby10;
removed += 1;
@@ -317,8 +316,7 @@ fn bintodec(mantissa: u64, exponent: u32) decf64 = {
if (vmmod10 != 0) break;
const vpby10 = vp / 10, vrby10 = vr / 10;
const vrmod10 = (vr: u32) - 10 * (vrby10: u32);
- vr_trailing_zeros = vr_trailing_zeros &&
- (last_removed_digit == 0);
+ vr_trailing_zeros &&= last_removed_digit == 0;
last_removed_digit = vrmod10: u8;
vr = vrby10; vp = vpby10; vm = vmby10;
removed += 1;