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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 28th October 2023, 17:35   #1  |  Link
Rob105
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.
Rob105 is offline   Reply With Quote
Old 28th October 2023, 18:10   #2  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
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...
Boulder is offline   Reply With Quote
Old 28th October 2023, 19:33   #3  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
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:
If say i do 1000/3 AviSynth+ outputs 333 not 333.3
With Integer math, is sortof like,

Code:
1000/3 = 333, Remainder 1.
Or
Code:
1000 / 3 = 333
1000 % 3 = 1
EDIT: So
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
But
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.
StainlessS is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:41.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.