Forum Replies Created

Viewing 15 posts - 4,066 through 4,080 (of 6,037 total)

  • RE: Bankers Rounding

    "So,

    WHY

    0.666 is valid 3 digits precision representation of 2/3"

    It's not. The valid 3 digit precision representation of 2/3 is 0.667. Did the devil make you do that?

    </I?

    Really?

    Did you see numbers...

    _____________
    Code for TallyGenerator

  • RE: Round to Even (aka Banker''''s Rounding) - The final function

    Whole bunch of examples where FLOAT (DOUBLE PRECISION) fails is in 1st topic.

    Regarding second one:

    DECLARE

    @enumerator DECIMAL(38, 12)

    ,@denominator DECIMAL(38, 12)

    SELECT

    @enumerator = 50

    ,@denominator = 111.111

    SELECT @enumerator/@denominator,

    ...

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    JacekO, did you notice my post clarifiyng what was wrong with initial version of the function?

    Post after which everything became clear?

    Yes, I fixed the function, but I cannot fix...

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    David, nobody can stop you from wasting your time on implementation.

    Just take this for testing:

    DECLARE

    @enumerator DECIMAL(35, 25)

    ,@denominator DECIMAL(35, 25)

    SELECT

    @enumerator = 5

    ,@denominator = 111.111

    SELECT @enumerator/@denominator,

    dbo.fn_BRound(@enumerator/@denominator,...

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    David,

    the only person who demonstrates stupidity is you (not only, actually, but not me ).

    I passed to BR 2 representations of the same value...

    _____________
    Code for TallyGenerator

  • RE: SQL Query Question

    According to the definition of table #tmp it's

    table_name, column_name, num_records

    where you've got value '20202'.

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    BTW, I'm thrilled to see the implementation of BR which will round 100000000.01/800000000.01 correctly.

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    Where?

    I saw truncated value .66666666, not 2/3.

    Can you pass 2/3 = 0.(6) into that function?

    _____________
    Code for TallyGenerator

  • RE: SQL Query Question

    Just open tables sysobjects and syscolumns and change the names in the query correspondingly.

    id, xtype, etc.

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    So, I asked you to pass 2/3 to that function.

    Can you do it?

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    David, BR does not take into account next digits.

    It assumes that all digits following those you can see (depending on precision you've got) are zeros.

    Which is an impossible event.

    That's...

    _____________
    Code for TallyGenerator

  • RE: Bankers Rounding

    DECLARE

    @enumerator decimal(23,15)

    ,@denominator decimal(23,15)

    SELECT

    @enumerator = 2

    ,@denominator = 3

    SELECT @enumerator/@denominator,

    dbo.fn_BRound(@enumerator/@denominator, 100)

    ,Round(@enumerator/@denominator,2)

    ---------------------------------------- --------------------- ----------------------------------------

    .666666666666666 ...

    _____________
    Code for TallyGenerator

  • RE: SQL Query Question

    sys.objects and sys.columns are from system catalog in SQL2005.

    For SQL2000 use sysobjects and syscolumns.

    _____________
    Code for TallyGenerator

  • RE: SQL Query Question

    I don't think you read that post attentively enough.

    That script searches for a value in all columns of all user tables.

    _____________
    Code for TallyGenerator

Viewing 15 posts - 4,066 through 4,080 (of 6,037 total)