Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What's wrong with that? It seems like the easiest way to write code that works with either floats or doubles.



Eh... I have seen the same in Rust. People write tests with i32. i32 implements the Copy trait which means your can blindly clone it all over the place. When you try using some libraries with String or anything else they don't work.


> It seems like the easiest way to write code that works with either floats or doubles.

You never really need to do that. In the rare cases you need to, once every five years or so, it is trivial to change your code.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: