亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? lib_math.c

?? UCOS-III
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/LIB
*                                        CUSTOM LIBRARY MODULES
*
*                          (c) Copyright 2004-2011; Micrium, Inc.; Weston, FL
*
*               All rights reserved.  Protected by international copyright laws.
*
*               uC/LIB is provided in source form to registered licensees ONLY.  It is 
*               illegal to distribute this source code to any third party unless you receive 
*               written permission by an authorized Micrium representative.  Knowledge of 
*               the source code may NOT be used to develop a similar product.
*
*               Please help us continue to provide the Embedded community with the finest 
*               software available.  Your honesty is greatly appreciated.
*
*               You can contact us at www.micrium.com.
*********************************************************************************************************
*/

/*
*********************************************************************************************************
*
*                                        MATHEMATIC OPERATIONS
*
* Filename      : lib_math.c
* Version       : V1.35.00
* Programmer(s) : SR
*                 ITJ
*********************************************************************************************************
* Note(s)       : (1) NO compiler-supplied standard library functions are used in library or product software.
*
*                     (a) ALL standard library functions are implemented in the custom library modules :
*
*                         (1) \<Custom Library Directory>\lib_*.*
*
*                         (2) \<Custom Library Directory>\Ports\<cpu>\<compiler>\lib*_a.*
*
*                               where
*                                       <Custom Library Directory>      directory path for custom library software
*                                       <cpu>                           directory name for specific processor (CPU)
*                                       <compiler>                      directory name for specific compiler
*
*                     (b) Product-specific library functions are implemented in individual products.
*
*********************************************************************************************************
* Notice(s)     : (1) The Institute of Electrical and Electronics Engineers and The Open Group, have given
*                     us permission to reprint portions of their documentation.  Portions of this text are
*                     reprinted and reproduced in electronic form from the IEEE Std 1003.1, 2004 Edition,
*                     Standard for Information Technology -- Portable Operating System Interface (POSIX),
*                     The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute
*                     of Electrical and Electronics Engineers, Inc and The Open Group.  In the event of any
*                     discrepancy between these versions and the original IEEE and The Open Group Standard,
*                     the original IEEE and The Open Group Standard is the referee document.  The original
*                     Standard can be obtained online at http://www.opengroup.org/unix/online.html.
*********************************************************************************************************
*/


/*
*********************************************************************************************************
*                                            INCLUDE FILES
*********************************************************************************************************
*/

#define    LIB_MATH_MODULE
#include  <lib_math.h>


/*$PAGE*/
/*
*********************************************************************************************************
*                                            LOCAL DEFINES
*********************************************************************************************************
*/


/*
*********************************************************************************************************
*                                           LOCAL CONSTANTS
*********************************************************************************************************
*/


/*
*********************************************************************************************************
*                                          LOCAL DATA TYPES
*********************************************************************************************************
*/


/*
*********************************************************************************************************
*                                            LOCAL TABLES
*********************************************************************************************************
*/


/*
*********************************************************************************************************
*                                       LOCAL GLOBAL VARIABLES
*********************************************************************************************************
*/

RAND_NBR  Math_RandSeedCur;                                     /* Cur rand nbr seed.                                   */


/*
*********************************************************************************************************
*                                      LOCAL FUNCTION PROTOTYPES
*********************************************************************************************************
*/


/*
*********************************************************************************************************
*                                     LOCAL CONFIGURATION ERRORS
*********************************************************************************************************
*/


/*$PAGE*/
/*
*********************************************************************************************************
*                                             Math_Init()
*
* Description : (1) Initialize Mathematic Module :
*
*                   (a) Initialize random number seed value
*
*
* Argument(s) : none.
*
* Return(s)   : none.
*
* Caller(s)   : Application.
*
* Note(s)     : (2) IEEE Std 1003.1, 2004 Edition, Section 'rand() : DESCRIPTION' states that "if rand()
*                   is called before any calls to srand() are made, the same sequence shall be generated
*                   as when srand() is first called with a seed value of 1".
*********************************************************************************************************
*/

void  Math_Init (void)
{
    Math_RandSetSeed((RAND_NBR)RAND_SEED_INIT_VAL);             /* See Note #2.                                         */
}


/*$PAGE*/
/*
*********************************************************************************************************
*                                         Math_RandSetSeed()
*
* Description : Set the current pseudo-random number generator seed.
*
* Argument(s) : seed        Initial (or current) value to set for the pseudo-random number sequence.
*
* Return(s)   : none.
*
* Caller(s)   : Application.
*
* Note(s)     : (1) IEEE Std 1003.1, 2004 Edition, Section 'rand() : DESCRIPTION' states that "srand() 
*                   ... uses the argument as a seed for a new sequence of pseudo-random numbers to be 
*                   returned by subsequent calls to rand()".
*
*               (2) 'Math_RandSeedCur' MUST always be accessed exclusively in critical sections.
*
*                   See also 'Math_Rand()  Note #1b'.
*********************************************************************************************************
*/

void  Math_RandSetSeed (RAND_NBR  seed)
{
    CPU_SR_ALLOC();


    CPU_CRITICAL_ENTER();
    Math_RandSeedCur = seed;
    CPU_CRITICAL_EXIT();
}


/*$PAGE*/
/*
*********************************************************************************************************
*                                             Math_Rand()
*
* Description : Calculate the next pseudo-random number.
*
* Argument(s) : none.
*
* Return(s)   : Next pseudo-random number in the sequence after 'Math_RandSeedCur'.
*
* Caller(s)   : Application.
*
* Note(s)     : (1) (a) The pseudo-random number generator is implemented as a Linear Congruential 
*                       Generator (LCG).
*
*                   (b) The pseudo-random number generated is in the range [0, RAND_LCG_PARAM_M].
*
*                   See also 'Math_RandSeed()  Note #1'.
*
*               (2) (a) IEEE Std 1003.1, 2004 Edition, Section 'rand() : DESCRIPTION' states that "rand() 
*                       ... need not be reentrant ... [and] is not required to be thread-safe".
*
*                   (b) However, in order to implement Math_Rand() as re-entrant; 'Math_RandSeedCur' MUST 
*                       always be accessed & updated exclusively in critical sections.
*
*                   See also 'Math_RandSeed()  Note #2'.
*********************************************************************************************************
*/

RAND_NBR  Math_Rand (void)
{
    RAND_NBR  seed;
    RAND_NBR  rand_nbr;
    CPU_SR_ALLOC();


    CPU_CRITICAL_ENTER();
    seed             = Math_RandSeedCur;
    rand_nbr         = Math_RandSeed(seed);
    Math_RandSeedCur = rand_nbr;
    CPU_CRITICAL_EXIT();

    return (rand_nbr);
}


/*$PAGE*/
/*
*********************************************************************************************************
*                                           Math_RandSeed()
*
* Description : Calculate the next pseudo-random number.
*
* Argument(s) : seed        Initial (or current) value for the pseudo-random number sequence.
*
* Return(s)   : Next pseudo-random number in the sequence after 'seed'.
*
* Caller(s)   : Math_Rand(),
*               Application.
*
* Note(s)     : (1) (a) BSD/ANSI-C implements rand() as a Linear Congruential Generator (LCG) :
*
*                       (A) random_number       =  [(a * random_number ) + b]  modulo m
*                                        n + 1                        n
*
*                               where
*                                       (1) (a) random_number           Next     random number to generate
*                                                            n+1
*                                           (b) random_number           Previous random number    generated
*                                                            n
*
*                                       (2) a = RAND_LCG_PARAM_A        LCG multiplier
*                                       (3) b = RAND_LCG_PARAM_B        LCG incrementor
*                                       (4) m = RAND_LCG_PARAM_M + 1    LCG modulus
*
*                   (b) The pseudo-random number generated is in the range [0, RAND_LCG_PARAM_M].
*
                    See also 'lib_math.h  RANDOM NUMBER DEFINES  Note #1b'.
*
*               (2) (a) IEEE Std 1003.1, 2004 Edition, Section 'rand() : DESCRIPTION' states that "rand() 
*                       ... need not be reentrant ... [and] is not required to be thread-safe".
*
*                   (b) However, Math_RandSeed() is re-entrant since it calculates the next random number 
*                       using ONLY local variables.
*********************************************************************************************************
*/

RAND_NBR  Math_RandSeed (RAND_NBR  seed)
{
    RAND_NBR  rand_nbr;


    rand_nbr = (((RAND_NBR)RAND_LCG_PARAM_A * seed) + (RAND_NBR)RAND_LCG_PARAM_B)  %  ((RAND_NBR)RAND_LCG_PARAM_M + 1u);

    return (rand_nbr);
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一级黄色片| 成人高清视频免费观看| 欧美性生交片4| 亚洲伊人色欲综合网| 91久久国产最好的精华液| 亚洲一区电影777| 欧美日韩国产大片| 美女性感视频久久| 久久九九影视网| eeuss鲁片一区二区三区在线看| 懂色av一区二区在线播放| 337p粉嫩大胆色噜噜噜噜亚洲| 久久精品国产澳门| www久久精品| 成人综合在线观看| 亚洲网友自拍偷拍| 日韩欧美国产不卡| 国产99精品视频| 亚洲精品大片www| 欧美精选在线播放| 国产一区二区看久久| 中文字幕在线观看不卡视频| 欧美视频日韩视频在线观看| 久久精品国产99国产精品| 亚洲国产成人在线| 欧美中文字幕一区二区三区| 精品一区二区三区在线观看| 中文字幕制服丝袜成人av | 欧美一区二区在线视频| 久久99蜜桃精品| 欧美一级xxx| 岛国精品在线观看| 亚洲午夜电影在线观看| 精品捆绑美女sm三区| 99久久国产综合精品色伊| 午夜精品影院在线观看| 久久精品一二三| 欧美日韩国产欧美日美国产精品| 国产一区二区视频在线| 亚洲一二三四久久| 国产午夜精品久久| 51久久夜色精品国产麻豆| 丁香六月综合激情| 蜜桃在线一区二区三区| 亚洲情趣在线观看| 久久精品亚洲精品国产欧美| 欧美精品xxxxbbbb| 不卡av电影在线播放| 久久国产人妖系列| 亚洲国产综合在线| 中文字幕人成不卡一区| 久久影音资源网| 在线电影国产精品| 伊人一区二区三区| 精品女同一区二区| 色女孩综合影院| 激情六月婷婷久久| 天堂成人国产精品一区| 一区视频在线播放| 26uuu精品一区二区在线观看| 欧美亚洲高清一区| av网站免费线看精品| 国产精品一区二区你懂的| 婷婷久久综合九色国产成人| 亚洲摸摸操操av| 国产精品天美传媒| 中文字幕国产一区| 久久久另类综合| 精品国产乱码久久久久久老虎| 欧美丰满高潮xxxx喷水动漫| 日韩久久久久久| 欧美日韩国产精品自在自线| 91精品办公室少妇高潮对白| 99精品欧美一区二区三区小说 | 成熟亚洲日本毛茸茸凸凹| 亚洲1区2区3区4区| 一区二区三区欧美久久| 亚洲欧美aⅴ...| 亚洲欧美日韩电影| 亚洲视频一区二区在线| 中文字幕中文在线不卡住| 中文字幕中文字幕在线一区 | 亚洲3atv精品一区二区三区| 亚洲影视资源网| 亚洲亚洲人成综合网络| 亚洲国产精品久久久久秋霞影院 | 精品国产乱码久久久久久久久| 日韩欧美一级二级三级久久久 | 91精品国产综合久久精品麻豆| 欧美日韩免费在线视频| 欧美日本一区二区在线观看| 欧美高清hd18日本| 日韩欧美激情一区| 欧美精品一区二区三区蜜臀 | 国产精品午夜春色av| 国产精品久久久久一区二区三区共| 国产精品三级电影| 一区二区在线看| 日韩一区精品视频| 激情小说亚洲一区| 成人app软件下载大全免费| av中文字幕不卡| 欧美在线免费观看亚洲| 91精品国产色综合久久ai换脸 | 色www精品视频在线观看| 欧美亚洲愉拍一区二区| 日韩一级片在线播放| 久久九九全国免费| 亚洲精品国产一区二区三区四区在线| 亚洲尤物在线视频观看| 免费高清不卡av| 春色校园综合激情亚洲| 欧美私模裸体表演在线观看| 日韩精品一区二区三区蜜臀| 国产清纯白嫩初高生在线观看91| 亚洲色图欧洲色图| 日日噜噜夜夜狠狠视频欧美人| 国产一区二区在线观看免费| 91麻豆免费在线观看| 日韩一区二区精品在线观看| 国产欧美精品一区二区三区四区| 一区二区欧美视频| 国产美女av一区二区三区| 日本高清不卡在线观看| ww久久中文字幕| 一区二区三区欧美在线观看| 国模一区二区三区白浆| 欧美中文字幕一二三区视频| 久久久久久久久久久久电影| 亚洲一区二区三区视频在线播放| 激情深爱一区二区| 欧美色图激情小说| 国产精品美女久久久久av爽李琼| 日日摸夜夜添夜夜添精品视频| 北条麻妃一区二区三区| 日韩欧美色综合网站| 一区二区三区欧美| 成人一道本在线| 日韩一区二区三区精品视频| 伊人夜夜躁av伊人久久| 丁香激情综合国产| 欧美精品一区二区不卡| 亚洲电影视频在线| 91免费视频网址| 国产亚洲成av人在线观看导航| 日韩精品亚洲专区| 在线视频国内一区二区| 中国av一区二区三区| 韩国精品一区二区| 91精品国产综合久久精品性色| 一区二区高清视频在线观看| hitomi一区二区三区精品| 久久先锋资源网| 另类综合日韩欧美亚洲| 欧美日韩亚洲国产综合| 亚洲精品乱码久久久久久| 成人高清视频在线观看| 国产日韩视频一区二区三区| 精品在线播放免费| 日韩一区二区在线观看视频 | 欧美私人免费视频| 亚洲精品大片www| 色综合天天综合| 亚洲私人黄色宅男| 成人美女视频在线观看18| 国产日韩欧美高清| 国产综合一区二区| 久久久噜噜噜久噜久久综合| 精品一区二区三区在线播放| 日韩欧美国产wwwww| 久久精品国产久精国产| 欧美大度的电影原声| 久久福利视频一区二区| 欧美电影免费观看高清完整版在线观看 | 久久久精品欧美丰满| 国产在线不卡一区| 久久综合色天天久久综合图片| 九九视频精品免费| 国产日韩精品一区| 成人激情黄色小说| 亚洲视频在线一区观看| 91极品视觉盛宴| 首页综合国产亚洲丝袜| 在线不卡免费欧美| 老司机精品视频线观看86| 337p日本欧洲亚洲大胆精品| 国产成人在线电影| 国产精品久久久久久久久免费相片| eeuss国产一区二区三区| 尤物av一区二区| 91.成人天堂一区| 日韩电影一区二区三区| 久久久亚洲午夜电影| caoporm超碰国产精品| 亚洲国产aⅴ天堂久久| 日韩欧美色综合| 波多野结衣在线aⅴ中文字幕不卡| 日韩一区欧美小说| 欧美精品99久久久**| 国产一区二区在线免费观看|