Can you provide a real example where your seconds(tv) function does not give a different value to seconds(tv+1) or seconds(tv-1)?
I haven't had a chance to test the 1000000000/tv96_to_usec(tv96) method yet. Just looking at it, you can tell it's ripe for overflow. Plus, it only has 3 digits of precision in the result, so the low digit of 1/3200 isn't valid. I can't add another 0 to the numerator to get another digit, because that's a 33 bit signed number. The problem isn't producing different values. The problem is that there aren't enough digits of precision.
But why do you demand an example when you're casting 24 bit (float) to 32 bit (int)? It's obvious that (double) should be used. There aren't any time critical calculations involved. What's the advantage of using (float) instead of (double) here, anyway?
You also should be able to use tv96_to_usec(-tv96) to get 1/xx.xxx shutter times. 1/3200 needs tv96=-1188, but that evaluates to 1/2147, which is the max positive int. Anything larger than tv96=1064 results in 2147 as a result. The fixed usec unit is very limiting.
You do get the same sv96_to_iso(sv96) results for a change of 1 sv96 when you start at ISO 80, for example. There are 96 sv96 units between ISO 80 and ISO 160, but only 80 ISO units. People may also want to use lower ISO than 80. This is why I added an optional scale to ISO. I'm not as worried about this as the shutter time problem, although the SX50 does start at 80 ISO.
Is there anything special about seconds, why not just display the Tv96 number ?
I used to do that, but it's more understandable to input and output in seconds. It's like saying, "I'll call you back in -576 tv96" instead of "I'll call you in a minute."
I usually want to enter the maximum shutter time in seconds, i.e. 15 seconds, and the minimum as 1/seconds, i.e. 1/3200 seconds. I don't think microseconds is a unit that's used in photography much. The seconds_to_tv96() function is perfect for this:
tv96Max=seconds_to_tv96(tmax,1)
tv96Min=seconds_to_tv96(1,tmin)
It's reasonable to want the seconds display to be 1/xx.xxx for shutter times less than 1/2 second, and xx.xxxx for times longer than 1/2 second. That's what my seconds(tv) Lua function does, and that's where I discovered the overflow, and precision problems with tv96_to_usec(tv96). tv96_to_seconds(tv96,1000) is equivalent to my original tv96_to_shutter(tv96,scale), which worked well.