I'm basically trying to write a quick light meter given a fixed aperture setting. This will give you the cameras estimated shutter speed for a given light condition. (This is useful for those of us without manual, Tv, Av modes).
Basics..
Tv = log2 (1 / T)
lets say x is our shutter speed (1/100)
x = 100
the value y, will be the camera's value for 1/100 (get_tv96) which is around 637
y = ~637
[(ln(x) / ln(2)) x 96] = y
solving for x we get..
x = e^(y/96 * ln(2))
Obviously CHDK doesn't have a log/ln function, nor does it have the constant "e". I can get around this, since I can hard-code approximations of "e" and ln(2). However, CHDK doesn't appear to have an exponent function, so I'm stuck.
Am I doing this the hard way? Is there a function that will just display Tv as a fraction? I suppose even a decimal might work at this point..