GKRootWire
AI Google Adds 'Preferred Source' Button to Help Publishers Fight AI Traffic LossesGadgets Linkdaze Launches a Smart Calendar Aimed at Running Your Whole HouseholdSecurity Popular Rust Crate arrayref Hijacked to Spread Infostealer MalwareCloud & Sysadmin GitHub Details Cause of August 17 Outage, Outlines Reliability FixesDev Tools Show HN: 'Huzzah' Proposes a Fresh Take on AI-Assisted CodingCloud & Sysadmin The Weird Science of Cooling Data Centers With UrineAI Google Adds 'Preferred Source' Button to Help Publishers Fight AI Traffic LossesGadgets Linkdaze Launches a Smart Calendar Aimed at Running Your Whole HouseholdSecurity Popular Rust Crate arrayref Hijacked to Spread Infostealer MalwareCloud & Sysadmin GitHub Details Cause of August 17 Outage, Outlines Reliability FixesDev Tools Show HN: 'Huzzah' Proposes a Fresh Take on AI-Assisted CodingCloud & Sysadmin The Weird Science of Cooling Data Centers With Urine
Dev Tools

Why 'Turns' Might Beat Radians for Angle Math in Code

A performance-focused programming blog argues that measuring angles in turns simplifies code and avoids common floating-point pitfalls.

A recent post from Computer Enhance makes the case that programmers should ditch radians in favor of 'turns' — where a full circle equals 1.0 instead of 2π — when writing angle-related code.

The argument centers on practicality: radians introduce awkward multiplication and division by π everywhere in your codebase, and small floating-point errors can compound in ways that are hard to debug. Using turns (0 to 1 for a full rotation) simplifies comparisons, wrapping logic, and interpolation, since you're just dealing with fractions rather than transcendental constants.

The piece sparked a modest but engaged discussion among developers about tradeoffs — some pointed out that many math libraries and hardware functions still expect radians, meaning you'd need conversion at some boundary regardless.

Why it matters: This is a niche but recurring debate among game and graphics programmers: representation choices for angles affect precision, readability, and interop with existing math libraries. It's a good reminder that seemingly 'settled' conventions in programming are worth periodically re-examining for practical wins.

Sources: Hacker News