forked from scratchfoundation/scratch-vm
-
Notifications
You must be signed in to change notification settings - Fork 113
Description
Although these mishaps only tend to create missed optimizations it seems, they should still likely be fixed in case they cause more incorrect optimizations (primarily having to do with NaNs):
canBeNaN:REAL / 0 = NaNis not correct -- it should beNUMBER_ANY_ZERO / NUMBER_ANY_ZERO. Currently the right hand side is only checked to be positive 0 which causes immediate and easily replicable issues by just doing(((0) / (-0)) + (1))
canBePos/canBeNeg:- Infinity checks aren't checked here, but could be checked in the
NUMBER_POS_INFandNUMBER_NEG_INFcases
- Infinity checks aren't checked here, but could be checked in the
canBeInfinity:Infinity / 0 = Infinityshould instead beNUMBER_POS / 0-- similarly for-Infinity / -0POS_REAL / NUMBER_OR_NAN ~= Infinityshould instead bePOS_REAL / POS_REAL-- a similar case should be done forNEG_REAL / NEG_REAL- This is of course because of rounding up to Infinity
Infinity / POS_REALis also Infinity, similarly to-Infinity / NEG_REAL
canBeNegInfinity:-Infinity / 0 = -Infinityshould instead beNUMBER_NEG / 0-- similarly forInfinity / -0NEG_REAL / NaN = -Infinityshould not be included because the inputs are forced to beNUMBER, notNUMBER_OR_NANNEG_REAL / NUMBER_OR_NAN ~= -Infinityshould instead beNEG_REAL / POS_REALorPOS_REAL / NEG_REALInfinity / NEG_REALis also Infinity, similarly to-Infinity / POS_REAL
Also NUMBER_FRACT is never set with this. I don't know if that was intentional or not but it's not like the enum is used for anything as of now anyways.
Metadata
Metadata
Assignees
Labels
No labels