Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cos(0) should be 1 #31

Open
john-blackburn opened this issue Sep 23, 2023 · 1 comment
Open

cos(0) should be 1 #31

john-blackburn opened this issue Sep 23, 2023 · 1 comment

Comments

@john-blackburn
Copy link

f24/f24cos.z80 says cos(0)==0 in the comments. But cos(0)=1

@john-blackburn
Copy link
Author

john-blackburn commented Sep 29, 2023

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

:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant