What do decimal operations need to be aware of? interface and abstract class WinForm two panel on the form, how to implement a panel fixed floating on top of another panel

Source: Internet
Author: User

What do decimal operations need to be aware of?

1. Life is 0.1+0.2=0.3, the computer may not be so, why?

Everyone knows that computer types are data-scoped. The shape int range is plus or minus 2.1 billion, the decimal type also has a range, but even if 0.1~0.2 before asking how many decimals do you have? Infinity!!!

So how does a limited range represent infinite data? Tell you no, you can only store an infinitely close number.

In addition, we all know that the computer all data is binary, 0.5 that is 2-1, 0.25 is 2-2 times, also explains why cannot express all decimals.

So everyone can understand the following example 100 0.1 Add why not equal to ten .

Because the computer is an infinitely close with 0.1 of the number to represent 0.1, so a number of errors to participate in the calculation, the more involved in the greater the error .

2. For the above situation, what is the financial handling of the decimal arithmetic?

If a decimal is encountered, it is enlarged to an integer, and the final result is calculated and divided by the multiplier of the enlargement. Please look

--

Interfaces and abstract classes

Many interviewers, or developers, may be in the development of a module when they are designed to abstract class, interface, which, or based on what principles to design?

1. Definition

interface: An abstraction with a set of identical behaviors .

Key points: A group, the same, behavior, abstraction.

Abstract class: Is an abstraction of a set of classes.

Key: A class that has two members: A variable member, a method (behavior) member.

A comprehensive definition can be seen as an abstraction of an interface multivariable member, which means that when only one set of methods (behavior) is consistent, consider an interface; when there are variables, methods (behaviors), a set of class abstractions of the two members are considered abstract classes.

--

What are the members of a class?

The class has two members, the State (Variable field) and the behavior (methods and other method functions).

Second, often an article expression class has a State or stateless, refers to whether the class has a variable.

--

WinForm Form two panel, how to implement a panel fixed floating on top of another panel

Issue: WinForm form, to enable a panel to float on top of another panel, but move the mouse or other action while running, the panel on the top will disappear? That is, only one panel can be displayed.

Cause: Drag-and-drop controls on a form the naked eye is a peer, in essence, a panel belongs to the other panel's child controls, that is, the back-up control is a child control that comes in first. So you run into another control.

Workaround: Open vs in view-Document outline, view hierarchy relationship. Two to the same level, that is, the WinForm form, the perfect solution (such as)

What do decimal operations need to be aware of? interface and abstract class WinForm two panel on the form, how to implement a panel fixed floating on top of another panel

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.