File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 1
1
//
2
2
// ZEPTO-8 — Fantasy console emulator
3
3
//
4
- // Copyright © 2016–2023 Sam Hocevar <[email protected] >
4
+ // Copyright © 2016–2024 Sam Hocevar <[email protected] >
5
5
//
6
6
// This program is free software. It comes without any warranty, to
7
7
// the extent permitted by applicable law. You can redistribute it
@@ -172,7 +172,7 @@ struct fix32
172
172
// Free functions
173
173
174
174
// PICO-8 0.2.3 changelog: abs(0x8000) should be 0x7fff.ffff
175
- static inline fix32 abs (fix32 a) { return a.m_bits > 0 ? a : - a.m_bits > 0 ? ~a : -a; }
175
+ static inline fix32 abs (fix32 a) { return a.m_bits >= 0 ? a : a.m_bits << 1 == 0 ? ~a : -a; }
176
176
177
177
static inline fix32 min (fix32 a, fix32 b) { return a < b ? a : b; }
178
178
static inline fix32 max (fix32 a, fix32 b) { return a > b ? a : b; }
You can’t perform that action at this time.
0 commit comments