mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
- The '#' component for type 's' now escapes the string characters - The '#' component for type 'f' now prints a precision suffix - The new 'q' component specifies a precision value
25 lines
544 B
NASM
25 lines
544 B
NASM
MACRO compare
|
|
print "\3: "
|
|
if _NARG == 4
|
|
def v1 = \3(\4q\1, \1)
|
|
def v2 = \3(\4q\2, \2)
|
|
elif _NARG == 5
|
|
def v1 = \3(\4q\1, \5q\1, \1)
|
|
def v2 = \3(\4q\2, \5q\2, \2)
|
|
endc
|
|
println "{.4q\1f:v1} == {.4q\2f:v2}"
|
|
ENDM
|
|
|
|
compare 8, 16, mul, 6.0, 7.0
|
|
compare 12, 24, div, 115.625, 9.25
|
|
compare 7, 14, pow, 3.5, 5.5
|
|
|
|
compare 4, 8, sin, 0.25
|
|
compare 5, 9, cos, 0.75
|
|
compare 6, 10, asin, 1.0
|
|
compare 7, 11, acos, 0.0
|
|
|
|
compare 3, 6, round, 1.75
|
|
compare 10, 20, ceil, 123.4
|
|
compare 13, 17, floor, 567.8
|