SW006013 Microchip Technology, SW006013 Datasheet - Page 113

MPLAB C Compiler For DsPIC DSCs

SW006013

Manufacturer Part Number
SW006013
Description
MPLAB C Compiler For DsPIC DSCs
Manufacturer
Microchip Technology
Series
DsPIC30F/33Fr
Type
MPLAB® C Compilerr
Datasheet

Specifications of SW006013

Supported Families
DsPIC30F, DsPIC33F
Core Architecture
DsPIC
Kit Contents
Software And Docs
Mcu Supported Families
DsPIC30F And DsPIC33F
Tool Function
Compiler
Tool Type
Compiler
Processor Series
dsPIC
Lead Free Status / RoHS Status
na
For Use With/related Products
dSPIC DSCs
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
© 2008 Microchip Technology Inc.
srand
Description:
Include:
Prototype:
Argument:
Return Value:
Remarks:
Example:
strtod
Description:
Include:
Prototype:
Arguments:
Return Value:
Remarks:
Set the starting seed for the pseudo-random number sequence.
<stdlib.h>
void srand(unsigned int seed);
seed
None
This function sets the starting seed for the pseudo-random number
sequence generated by the rand function. The rand function will
always return the same sequence of integers when identical seed val-
ues are used. If rand is called with a seed value of 1, the sequence of
numbers generated will be the same as if rand had been called without
srand having been called first.
#include <stdio.h>
#include <stdlib.h> /* for rand, srand */
int main(void)
{
}
Output:
Number = 16327
Number = 5931
Number = 23117
Number = 30985
Number = 29612
Converts a partial string to a floating-point number of type double.
<stdlib.h>
double strtod(const char *s, char **endptr);
s
endptr
Returns the converted number if successful; otherwise, returns 0.
The number may consist of the following:
optional whitespace, followed by an optional sign, then a sequence
of one or more digits with an optional decimal point, followed by one
or more optional digits and an optional e or E followed by an optional
signed exponent.
strtod converts the string until it reaches a character that cannot be
converted to a number. endptr will point to the remainder of the string
starting with the first unconverted character.
If a range error occurs, errno will be set.
int x;
srand(7);
for (x = 0; x < 5; x++)
[whitespace] [sign] digits [.digits]
printf("Number = %d\n", rand());
[ { e | E }[sign]digits]
starting value for the pseudo-random number sequence
string to be converted
pointer to the character at which the conversion stopped
/* for printf
*/
DS51456E-page 109

Related parts for SW006013