|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE reference |
|
11 PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd"> |
|
12 <reference id="GUID-9A38894D-98B8-5AFA-A36A-AC8B494EC2CC" xml:lang="en"><title>libmexample: |
|
13 Using the Standard C Math Library</title><shortdesc>This example demonstrates the use of math functions, such as <apiname>gamma(double)</apiname>, |
|
14 that are part of the Standard C Maths support library (<codeph>libm.dll</codeph>). </shortdesc><prolog><metadata><keywords/></metadata></prolog><refbody> |
|
15 <section id="GUID-D3589080-5DD4-5DDF-A269-A7D1687F4705"><title>Purpose</title> <p>This |
|
16 example application shows how to use the <filepath>libm.dll</filepath> library. |
|
17 It: </p> <ol id="GUID-BDAA52E1-6D3C-520C-9C3F-74A558955A86"> |
|
18 <li id="GUID-85A5E6A3-19BD-5060-A92E-CFAA7E522DF4"><p>reads an input value |
|
19 supplied by the user </p> </li> |
|
20 <li id="GUID-7D292EC7-FE00-5E35-9261-C11CB406CF32"><p>applies the gamma function |
|
21 on the input value </p> </li> |
|
22 <li id="GUID-B1C92272-17F9-5520-AC5D-A55B0C11963C"><p>prints the output. </p> </li> |
|
23 </ol> </section> |
|
24 <section id="GUID-2638D79E-A3D2-5A08-AFC3-00AF68C3C194-GENID-1-6-1-10-1-1-5-1-3-1-11-1-8-1-3-2"><title>Download</title> <p>Click |
|
25 on the following link to download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-b6b7503f-d331-4664-a6c8-a3e72b1f6c5b.zip" scope="external"> libmexample.zip</xref></p><p>Click: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-b6b7503f-d331-4664-a6c8-a3e72b1f6c5b.html" scope="peer">browse</xref> to view the example code. </p> </section> |
|
26 <section id="GUID-C3619B7E-3AF5-58D1-99D1-45CADE74B54C"><title>Class summary</title> <p>The |
|
27 example shows the use of the following API: </p> <ul> |
|
28 <li id="GUID-3DF01930-3A0E-5645-8D7E-F70321CB2B31"><p> <xref href="GUID-D1B12DAA-B281-3D8C-9CFF-A2062EA72A0A.dita"><apiname>gamma(double)</apiname></xref> from |
|
29 the Standard C Maths support library (<filepath>libm.dll</filepath>). </p> </li> |
|
30 </ul> </section> |
|
31 <section id="GUID-7D90F88D-B6DC-5287-AC55-AAF46443874A"><title>Building and |
|
32 configuring</title> <p>To build the example: </p> <ul> |
|
33 <li id="GUID-A00084B3-336E-57DE-A399-33DE044E6021"><p>You can build the example |
|
34 from your IDE or the command line. </p> <p>If you use an IDE, import the <filepath>bld.inf</filepath> file |
|
35 of the example into your IDE, and use the build command of the IDE. </p> <p>If |
|
36 you use the command line, open a command prompt, and set the current directory |
|
37 to the source code directory of the example. You can then build the example |
|
38 with the SBSv1 build tools with the following commands: </p> <p><userinput>bldmake |
|
39 bldfiles</userinput> </p> <p><userinput>abld build</userinput> </p> <p> <xref href="GUID-793A5EF9-CC16-5EEB-9011-6431EA76EB15.dita">How to use bldmake</xref> and <xref href="GUID-B6B54E07-3B34-5D5C-8815-93383FA8FB4B.dita">How to use abld</xref> describe |
|
40 how to use the SBSv1 build tools. </p> </li> |
|
41 <li id="GUID-91962C9F-6048-588E-8100-352354DC49C9"><p>For the emulator, the |
|
42 example builds an executable called <filepath>libmexample.exe</filepath> in |
|
43 the <filepath>epoc32\release\winscw\<udeb or urel>\</filepath> folder. </p> </li> |
|
44 </ul> </section> |
|
45 <section id="GUID-97F66C8D-36A9-50D4-8318-2A19BE9832D6"><title>Running the |
|
46 example</title> <p>Run the <filepath>libmexample.exe</filepath> executable. |
|
47 The example application waits for the user to enter an input value. </p> </section> |
|
48 </refbody></reference> |