Quad Loft Six into 50% pairs (quad six into parity) banker algorithm

Source: Internet
Author: User

Rules:

Four shed six into five considerations.
After five, non-zero in one,
After five, all zero look at the odd Couple,
I should give up five ago,
Five ago for the odd to enter one.

C#:

<textarea name="code" class="c#">Math.Round (new Decimal (1.2050), 2) 1.2math.round (new Decimal (1.2150), 2) 1.22math.round (New decimal (1.2250 ), 2) 1.22math.round (new Decimal (1.2350), 2) 1.24math.round (new Decimal (1.2450), 2) 1.24math.round (new D Ecimal (1.2550), 2) 1.26math.round (new Decimal (1.2650), 2) 1.26math.round (new Decimal (1.2750), 2) 1.28Mat H.round (New Decimal (1.2850), 2) 1.28math.round (new Decimal (1.2950), 2) 1.3</textarea>

Oracle

<textarea name="code" class="sql">CREATE OR REPLACE FUNCTION ROUND2 (P1 in number, P2 in number) RETURN Numberasbegin IF TRUNC (p1,p2+1) <>p1 OR SU BSTR (P1*power (10,p2+1), -1) <> ' 5 ' OR MOD (SUBSTR (P1*power (10,p2+1), -2,1), 2) =1 then RETURN ROUND (P1,P2); ELSE RETURN TRUNC (P1,P2); END IF; end;--Repair Constitution then/* Four six into five considerations,//Five after non-zero into one. After five is zero look parity,//five ago for I should shed,//five before the odd to enter one. </p><p>*/</textarea>

Quad Loft Six into 50% pairs (quad six into parity) banker algorithm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.