Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
28th October 2023, 17:35 | #1 | Link |
Registered User
Join Date: Oct 2021
Posts: 43
|
decimals removed after multiplying/deviding?
If say i do 1000/3 AviSynth+ outputs 333 not 333.3 how to i get decimals to stay, it seems like its auto rounding?
If i do something like (1000/3)*3 i get 999 instead of 1000 Last edited by Rob105; 28th October 2023 at 17:39. |
28th October 2023, 18:10 | #2 | Link |
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,733
|
You need to use a decimal point somewhere so Avisynth understands that you want a float. Like "1000./3".
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... |
28th October 2023, 19:33 | #3 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Same as Boulder said.
Result of arithmetic operators +,-,*,/ concerning two Int variables (or constants) will have type Int result. Where at least one of the operands is of type Float, then result will be of type Float (any type int operand converted to Float prior to operation). Quote:
Code:
1000/3 = 333, Remainder 1. Code:
1000 / 3 = 333 1000 % 3 = 1 Code:
1000.0/3.0 = 333.3 etc Code:
1000.0/3 = 333.3 etc Code:
1000/3.0 = 333.3 etc Code:
1000./3. = 333.3 etc Code:
1000./3 = 333.3 etc Code:
1000/3. = 333.3 etc Code:
1000/3 = 333
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 29th October 2023 at 12:56. |
|
|
|