View Single Post
Old 14th April 2019, 17:11   #5  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,829
Quote:
Originally Posted by Dreamject View Post
Wtf why am I must use float(number) to get correct result
Avisynth does integer maths by default. So...
4 / 3 = 1
whereas
4.0 / 3.0 = 1.33333333
(only one needs to be float and Avisynth should convert the other to float automatically)

I don't know what you're referring to specifically, but you can specify a number as float by adding a decimal point, so 4.0 is the same as float(4). Where are you having to use float? Are you referring to SVP or your port??

Many functions require a numerator and denominator as integers.
ie AssumeFPS(24000, 1001)
I sometimes find it annoying, especially when you have to type something like FPSNum=24000, FPSDen=1001.
For my CropResize script, which has a few aspect ratio arguments, I chose to do the equivalent of Aspect=1.7777 or Aspect=16.0/9.0
It forces you to specify fractions as float though, because Aspect=16/9 would be the same as Aspect=1, and obviously wouldn't produce the expected result.

That's hopefully the explanation, although without knowing specifically what you're referring to.

Last edited by hello_hello; 14th April 2019 at 17:30.
hello_hello is offline   Reply With Quote