4 ms·
you can have an internal representation enum and when calling sin(Angle a){ switch a.representation: rad : sin(a.rad); turn: nsin(a.turn) } conversio
by singularity2001 4y ago
you can have an internal representation enum and when calling
sin(Angle a){
switch a.representation:
rad : sin(a.rad);
turn: nsin(a.turn)
}
conversion only needed when adding angles of different representation.
- Asraelite 4y agoSounds like you're balancing out the performance gains the article talks about with performance losses from branching.
- munificent 4y agoNow your performance is even worse.