Md Kaif 7fd7e2db15
fix(float): abs(-0.0) should return 0.0 (#534)
abs(-0.0) returns -0.0 instead of 0.0, and math.fabs(-0.0) does the
same. Both come from the idiom (x < 0) ? -x : x. Since -0.0 < 0 is
false, the negative zero is returned unchanged.

The idiom appears twice, once in dmath_fabs and once open-coded in
float__abs__. Fix dmath_fabs by clearing the sign bit, the same way
dmath_copysign just above it works, and make float__abs__ call the
shared helper instead of repeating the comparison.

abs(-0.0) == 0.0 is true even with the bug, because -0.0 == 0.0 under
IEEE 754, so the added tests compare str(...) to check the sign.
2026-07-21 19:36:08 +08:00
..
2026-01-26 17:24:29 +08:00
...
2023-08-28 13:17:58 +08:00
2026-01-26 17:24:29 +08:00
2026-01-26 17:24:29 +08:00
2025-06-22 16:31:46 +08:00
2026-03-28 17:53:39 +08:00
2025-12-04 21:01:29 +08:00
2026-01-14 16:14:08 +08:00
2026-01-26 17:50:03 +08:00
2026-03-04 14:30:35 +08:00
2025-12-04 21:01:29 +08:00
2025-12-25 18:12:04 +08:00
2026-02-05 11:20:11 +08:00
2026-02-02 21:45:11 +08:00
2026-01-26 17:24:29 +08:00
2026-01-26 17:24:29 +08:00
2026-07-11 10:25:27 +08:00
2025-12-04 21:01:29 +08:00
2026-01-30 14:40:05 +08:00
up
2026-02-21 21:08:33 +08:00
2026-01-14 16:49:02 +08:00
up
2026-02-21 21:08:33 +08:00
2026-02-05 11:27:12 +08:00
2025-12-04 21:01:29 +08:00
2026-06-18 09:27:39 +08:00
2026-01-30 14:42:45 +08:00
2025-12-04 21:01:29 +08:00
up
2026-02-21 21:08:33 +08:00
2026-04-17 11:10:55 +08:00
2025-12-16 17:10:45 +08:00
2026-01-06 15:11:39 +08:00
2026-01-06 15:11:39 +08:00
2026-02-23 00:35:00 +08:00
2026-02-21 21:12:52 +08:00
2025-12-04 21:01:29 +08:00
2026-07-06 12:00:58 +08:00