Exponential property
Implementation
static Map<ETTypes,num Function(num,[num?])> Exponential = {
ETTypes.In:(amount,[power]) {
return amount == 0 ? 0 : math.pow(1024, amount - 1);
},
ETTypes.Out:(amount,[power]) {
return amount == 1 ? 1 : 1 - math.pow(2, -10 * amount);
},
ETTypes.InOut:(amount,[power]) {
if (amount == 0) {
return 0;
}
if (amount == 1) {
return 1;
}
if ((amount *= 2) < 1) {
return 0.5 * math.pow(1024, amount - 1);
}
return 0.5 * (-math.pow(2, -10 * (amount - 1)) + 2);
},
};