You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Historically we returned AVS_CLASSIC_VERSION_NUMBER which was 2.60 at that time, some ten years ago.
Now I ask you to return a more meaningful number.
I know that our 3-part versioning does not fit nicely into this floating point logic, but anyway, let's return 3.73 or 3.74 or 3.8.
Firstly because now it is not nice, we can change it to a larger number without concerns. The only use case was to decide if the core is at least Avisynth 2.6 (and not 2.58 for example - there had been huge changes in Avisynth 2.6)
Secondly (real deal breaker), because there is no good choice of storing it internally as 32 bit float or double.
Unfortunately (double)2.6f < 2.6
avs_as_float / AsFloat() always returned double, our magic value 2.6 (32 bit float) becomes 2.5999999046... when it leaves an AVSValue as double.
Now, that we are (will be soon- with the 64 bit changes) able to deal with real 64 bit doubles, this conversion does not happen.
That is:
GetVersion() < 2.6 will be true so it will break the scripts, scripts will think we are in the 2.5x era.
All the scripts I know are using VersionNumber like this
The only 'smart' comparison is for 2.58, it seems that the exact comparison with 2.58 was failing also, that's why the script writer was using 2.575 for safety.
The x264 project is using avs_get_version() when swscale not configured,
Which is getting the version number after a (float)(double)(float)(double)2.6 cast series, then compares with 2.6f.
It works O.K.
The text was updated successfully, but these errors were encountered:
From what I remember, AVS_CLASSIC_VERSION_NUMBER was intended as a way to signal it was compatible with this version of classic AviSynth, which would make more sense had classic survived long enough to actually move beyond 2.6. And that was because the regular versioning had moved on to show the Plus-specific stuff. Given that, IMO it'd be easier to just remove it entirely instead of changing it to match the other Plus things.
I don't even know what projects actually even rely on checking AVS_CLASSIC_VERSION_NUMBER, so I'm not sure what - if anything - would break from its removal.
What happens if it tries to return 2.61? That was only ever an alpha, but it was the final final version of classic, and we're definitely compatible with it too. I'll only say that 3.8 would definitely be wrong before we actually make that jump ourselves.
2.600000024f is a good choice, in SubTitle(String(VersionNumber()) it's shown as 2.6000000.
And as AsFloat returns it in double, it works in the scripts: VersionNumber() >= 2.6 is true, yeah.
Historically we returned
AVS_CLASSIC_VERSION_NUMBER
which was2.60
at that time, some ten years ago.Now I ask you to return a more meaningful number.
I know that our 3-part versioning does not fit nicely into this floating point logic, but anyway, let's return 3.73 or 3.74 or 3.8.
Firstly because now it is not nice, we can change it to a larger number without concerns. The only use case was to decide if the core is at least Avisynth 2.6 (and not 2.58 for example - there had been huge changes in Avisynth 2.6)
Secondly (real deal breaker), because there is no good choice of storing it internally as 32 bit float or double.
Unfortunately
(double)2.6f < 2.6
avs_as_float
/AsFloat()
always returned double, our magic value 2.6 (32 bit float) becomes2.5999999046...
when it leaves anAVSValue
as double.Now, that we are (will be soon- with the 64 bit changes) able to deal with real 64 bit doubles, this conversion does not happen.
That is:
GetVersion() < 2.6
will betrue
so it will break the scripts, scripts will think we are in the 2.5x era.All the scripts I know are using
VersionNumber
like thisThe only 'smart' comparison is for 2.58, it seems that the exact comparison with 2.58 was failing also, that's why the script writer was using 2.575 for safety.
The x264 project is using avs_get_version() when swscale not configured,
Which is getting the version number after a (float)(double)(float)(double)2.6 cast series, then compares with 2.6f.
It works O.K.
The text was updated successfully, but these errors were encountered: