z80float
z80float copied to clipboard
cos(0) should be 1
f24/f24cos.z80 says cos(0)==0 in the comments. But cos(0)=1
In my code I have changed the first few lines of this routine to
f24cos:
;cos(AHL) ==> AHL
;cos(0) == 1 ; fixed by JFB
add a,a
jr nz,f24cos_skip
ld a,$3F ; 1.0
ld hl,0
ret
;cos(inf)==cos(NaN)==NaN
f24cos_skip:
rrca
cp $7F
: