Floating point calculations?

Home Forums Scripting General Scripting Floating point calculations?

Viewing 1 post (of 1 total)
  • Author
    Posts
  • Avatar
    rack04
    Member
    #143279

    I’m trying to perform a simple calculation in a batch file but I’m having difficulties.

    Here is what I’m working with:

    set /a Factor= 480 / (%SOURCE_VIDWIDTH%000)
    set “Scale_Factor=%Factor:~0,-3%.%Factor:~-3%”
    set /a Output_Height= %Scale_Factor% * %SOURCE_VIDHEIGHT%
    set /a Border_Value= (320 – %Output_Height%) / 2

    Echo.
    Echo.
    Echo Spline64Resize(480,%Output_Height%)
    Echo AddBorders(0,%Border_Value%,0,%Border_Value%)
    Echo.
    Echo.[/CODE]

    In the example that I’m working with:

    SOURCE_VIDWIDTH=1280
    SOURCE_VIDHEIGHT=720

    Spline64Resize(480,0)
    AssumeFPS(0,160,0,160)[CODE]set /a Factor= 480 / (%SOURCE_VIDWIDTH%000)
    set “Scale_Factor=%Factor:~0,-3%.%Factor:~-3%”
    set /a Output_Height= %Scale_Factor% * %SOURCE_VIDHEIGHT%
    set /a Border_Value= (320 – %Output_Height%) / 2

    Echo.
    Echo.
    Echo Spline64Resize(480,%Output_Height%)
    Echo AddBorders(0,%Border_Value%,0,%Border_Value%)
    Echo.
    Echo.[/CODE]

    In the example that I’m working with:

    SOURCE_VIDWIDTH=1280
    SOURCE_VIDHEIGHT=720

    Spline64Resize(480,0)
    AssumeFPS(0,160,0,160)

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.