Closed amosr closed 6 years ago
I'll just add some sanity tests in a sec
interesting tidbit: ages ago, when classifying double operations into whether they produced nans or not, atan, atan2, cos, sin, tan and tanh are all "clean". it feels more consistent to just say all double operations are possibly, though. any preference?
I'm not confident enough in my double testing code to say for sure that all tans are valid. I believe that tan (pi/2) = sin (pi/2) / cos (pi/2) = 1 / 0
, so it should be able to produce infinity, even though for me cos (pi/2) = 6e-17
.
I don't think we lose anything by making them Possibly, so I'll keep it.
I realised integer modulo is a somewhat larger job, because it would need to be in Possibly (1 mod
0). the machinery for this is already in place for doubles, but would be a bit different for integers.
so, given we can already encode modulo clumsily, I will leave both modulo operations for later
going to hold off on merging this, because if anybody is using any of these as variable names it will break. I had a look but couldn't see any.
I'm tempted to add modulus, but I'm not sure whether int and double modulus are the same polymorphic operation, or if it should be
mod
andfmod
! @jystic @tranma