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

There is no correct answer. There is no correct answer. The various ways different languages handle implicit type conversion with division and modulo operations are all both correct and incorrect at the same time. It's really an arbitrary choice. In fact, there are more choices than presented above. I think, for example, Perl6, uses rational numbers in some of the above situations.


Indeed. But please note Perl 6 has been renamed to the Raku Programming Language (https://raku.org #rakulang).




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

Search: