Open sebffischer opened 10 months ago
Yeah - I'm not exactly sure either. Perhaps because in statistics, it's rare that you work with integers aside from the factor enum representation. Assuming that most use cases would eventually do some calculations with the value, perhaps it's better just to start with a double.
In my experience, I usually use integer values for general programming as individual values as index offsets or other constant values. When I use floating point math, it's usually large matrices to store data or fit models, so the most performance-intensive conversions would probably happen in those scenarios. Perhaps that was part of the rationale.
I am wondering what the reason is why R creates doubles by default even if all values are integer-valued.
Created on 2023-12-27 with reprex v2.0.2
One reason I can think of is that doubles are 64 bit, while integers are 32 bit by default, so creating doubles allows for a greater range of values.