[Cocos2d-js official documentation] 10, log, cocos2d-js document log

Source: Internet
Author: User
Tags base 10 logarithm

[Cocos2d-js official documentation] 10, log, cocos2d-js document log

Api changes, new on the left and original on the right.

Cc. log unchanged cc. warn added cc. error added cc. assert <-- cc. Assert

There are several reasons for this transformation:

  • Add existing APIs: cc. warn and cc. error.

  • Modify the cc. Assert name to conform to the development specifications.

Examples of new APIs:

cc.log("this is a log");cc.log("this is a log for %s", "Cocos2d-html5");cc.warn("this is a waring");cc.warn("this is a waring for %s", "Cocos2d-html5");cc.error("this is an error");cc.error("this is an error for %s", "Cocos2d-html5");cc.assert(false, "this is an assert");cc.assert(false, "this is an assert for %s", "Cocos2d-html5");

Then we will definemsgCode.js

cc.msgCode = {    log1 : "this is a log",    log2 : "this is a log for %s",    warn1 : "this is a waring",    warn2 : "this is a waring for %s",    error1 : "this is an error",    error2 : "this is an error for %s",    assert1 : "this is an assert",    assert2 : "this is an assert for %s",    throw1 : "this is an throw",    throw2 : "this is an throw for %s", "Cocos2d-html5"}

In this way, message strings can be reused to the maximum extent and facilitate management.


Reprinted: http://www.douapp.com/post/2454


The size of one-to-one math required to be compared: 1. If 1 is less than x <10, then (the log base is the logarithm of x), and the log base is the square of x; lg

Dizzy · This indicates that the method is really cool. Isn't it lg at the bottom of log? You just wrote (lgx) 2, lgx 2, and lg (lgx ).
Limit 1 <x <10
Limit 0 <lgx <1
∴ Lglgx <0 <(lgx) ² <lgx ² <1

Log base 10 times the base 10 logarithm

Log10 (10 √ 10)
= Log 10 (10 ^ (3/2 ))
= 3/2;

Please adopt

If you agree with my answer, please adopt it in time,
~ If you agree with my answer, please click the "accept as a satisfactory answer" button in time
~~ If you ask questions on your phone, click "satisfied" in the upper-right corner of the client.
~ Your adoption is the driving force for me to move forward
~~ O (primary _ primary) O, remember to praise and adopt, help each other

Related Article

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.