Fix bug in sfloat+ and add tests.

This commit is contained in:
Brad Nelson
2022-04-20 18:52:10 -07:00
parent 12f80aec2b
commit 54d745e798
2 changed files with 13 additions and 1 deletions

View File

@ -104,3 +104,15 @@ e: test-float-broken-parse
internals
s" teste" f>number? 0= assert
;e
e: test-sfloats
10 sfloats 40 =assert
;e
e: test-sfloat+
1 sfloat+ 5 =assert
;e
e: test-sfloat
sfloat 4 =assert
;e

View File

@ -45,7 +45,7 @@
XV(internals, "F>NUMBER?", FCONVERT, tos = fconvert((const char *) *sp, tos, fp); --sp) \
Y(SFLOAT, DUP; tos = sizeof(float)) \
Y(SFLOATS, tos *= sizeof(float)) \
X("SFLOAT+", SFLOATPLUS, DUP; tos += sizeof(float)) \
X("SFLOAT+", SFLOATPLUS, tos += sizeof(float)) \
X("PI", PI_CONST, *++fp = 3.14159265359f) \
Y(FSIN, *fp = sin(*fp)) \
Y(FCOS, *fp = cos(*fp)) \