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

Generics for numbers #1

Open
Libbum opened this issue Jan 18, 2018 · 0 comments
Open

Generics for numbers #1

Libbum opened this issue Jan 18, 2018 · 0 comments

Comments

@Libbum
Copy link
Owner

Libbum commented Jan 18, 2018

Currently we are only using f32s, but it would be good if this was generic over reals.

For example:

struct Sphere<N> {
    center: Point3<N>,
    radius: N,
}

impl<N: Float> Sphere<N> {
    /// Creates a `new` sphere given the location of the spheres' `center` and its' `radius`.
    pub fn new(center: Point3<N>, radius: N) -> Sphere {
... etc
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