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

table #132

Open
vitreo12 opened this issue Nov 22, 2020 · 1 comment
Open

table #132

vitreo12 opened this issue Nov 22, 2020 · 1 comment

Comments

@vitreo12
Copy link
Owner

vitreo12 commented Nov 22, 2020

static compilation of tables

#sine table
table sineTable 1024:
    return sin((i / 1023.0) * twopi)
@vitreo12
Copy link
Owner Author

Internally, const + block is the way to go:

const mytable : array[100, float] = block:
  var t : array[100, float]
  for i in 0..<100:
    t[i] = float(i)
  t

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