Skip to content

Commit 60c93d6

Browse files
author
thisismypassport
committed
fixed abs constfold (oops)
1 parent 2a04b55 commit 60c93d6

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

pico_constfold.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def lua_neg(a):
6868

6969
def lua_abs(a):
7070
if a.is_number() and a.value != 0x80000000: # avoid relying on clamping overflow behavior
71-
return LuaNumber(abs(a.value))
71+
return LuaNumber(abs(fixnum_to_signed(a.value)))
7272

7373
def lua_floor(a):
7474
if a.is_number():

shrinko8.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from pico_defs import get_default_version_id
1010
import argparse
1111

12-
k_version = 'v1.2.0d'
12+
k_version = 'v1.2.0e'
1313

1414
def SplitBySeps(val):
1515
return k_hint_split_re.split(val)

test_compare/const.p8

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ stop() -- for pure syntax check
1313
?-nil
1414
-- abs
1515
?1.3
16-
?65534.70002
17-
?32768.00002
16+
?1.3
17+
?32767.99999
1818
?abs(0x8000)
1919
-- flr
2020
?5

test_compare/constmin.p8

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ stop()?0
1010
?-false
1111
?-nil
1212
?1.3
13-
?-1.3
14-
?32768.00002
13+
?1.3
14+
?32767.99999
1515
?abs(32768)
1616
?5
1717
?5

0 commit comments

Comments
 (0)