Forum Replies Created

Viewing 15 posts - 4,096 through 4,110 (of 6,036 total)

  • RE: Bankers Rounding

    Still not sure?

    Try this:

    declare @d decimal(30,20),

    @a decimal(30,20),

    @b-2 decimal(30,20)

    select @a = 100001

    select...

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    Does this work for you?

    declare @d decimal(30,20),

    @a decimal(30,20),

    @b-2 decimal(30,20)

    select @a =...

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    Or you don't insist on presision on those numbers anymore?

    And now you do agree with me that 0.66666666 is valid perpresentations for all numbers between 0.66666666(0) and 0.66666666(9), including 2/3...

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    Are you sure .66666666000000000000 = 2/3?

    I checked:

    @d * @b-2 = 1.99999998000000000

    It's not = 2.

    So, can you please provide script where BR is rounding 2/3, but not any numbrer around?

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    That's funny:

    Bankers Rounding cannot round value 2/3.

    Can anybody provide a code disproving this statement?

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    No, that's set of data YOUR test provided.

    My test did not convert DECIMAL(8,3) values to money, so it would not fool anyone.

    In my test it was:

    Level of precision:

    4 digits ...

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    > On the 51st pass in that loop, the untruncated, unrounded number was indeed 0.0050.

    So, what did you mean when you wrote this:

    "Why in the world would you consider a...

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    > Your test was a series of numbers between 0.0000 and 1.9999, inclusive, with no 2.0 to be found.

    2.0 indicates start of the next interval, from 2.0 to 4.0.

    2.0...

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    You ran imprecise numbers.

    Your result is imprecise as well because of that.

    There was no 0.0050, it was 3 digits precision measurement of 0.00591232349283423847234... : 0.005.

    It's a matter of fact:

    Average of...

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    David,

    What's an AVERAGE for all numbers evenly distributed between 0 and 2?

    Do the MATH, not ARITH.

    The average is 1. Or 0.(9) if you wish.

    Difference SUM(Values)/COUNT(Values) and "1" shows level of...

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    Here is another script.

    Hope it satisfies all your criteria:

    DECLARE @A DECIMAL(8, 4), @b-2 DECIMAL(8, 3), @Step DECIMAL(8, 4)

    SET NOCOUNT ON

    SELECT @A = 0.0000, @Step = .0001

    IF Object_Id ('tempdb..#BRounding') IS...

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    David, are you drunk?

    BR returns the same result when precision allows to see the next number.

    So, BR returns different results depending on precision of source value is measured.

    Don't know which...

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    No problem:

    Declare @A Decimal(10, 3)

    Declare @b-2 Decimal(10, 4)

    SET @A = 0.1253

    SET @b-2 = 0.1253

    SELECT Round(@A, 2), dbo.fn_BRound(@A, 100)

    SELECT Round(@B, 2), dbo.fn_BRound(@B, 100)

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    As I see you have nothing to say anymore for defence of BR.

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    "If on the cell with an elephant you see the label "Hyppo" - don't believe your eyes".

    The name of this author will not say you anything.

    _____________
    Code for TallyGenerator

Viewing 15 posts - 4,096 through 4,110 (of 6,036 total)