PageRenderTime 2ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/www.cppreference.com/wiki/tr/c/math/abs

https://github.com/tsgates/cclookup
#! | 66 lines | 61 code | 5 blank | 0 comment | 0 complexity | 8eced3eb343b96f0594173a038a0774e MD5 | raw file
 1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="tr"
 4 lang="tr" dir="ltr">
 5<head>
 6  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 7  <title>tr:numeric:c:abs</title>
 8<meta name="generator" content="DokuWiki" />
 9<meta name="robots" content="index,follow" />
10<meta name="date" content="2010-10-28T18:17:27-0700" />
11<meta name="keywords" content="tr,numeric,c,abs" />
12<link rel="search" type="application/opensearchdescription+xml" href="http://www.cppreference.com/wiki/lib/exe/opensearch.php" title="C++ Reference" />
13<link rel="start" href="../../../../index.html" />
14<link rel="contents" href="http://www.cppreference.com/wiki/tr/numeric/c/abs?do=index" title="İndeks" />
15<link rel="alternate" type="application/rss+xml" title="Recent Changes" href="http://www.cppreference.com/wiki/feed.php" />
16<link rel="alternate" type="application/rss+xml" title="Current Namespace" href="http://www.cppreference.com/wiki/feed.php?mode=list&amp;ns=tr:numeric:c" />
17<link rel="alternate" type="text/html" title="Plain HTML" href="http://www.cppreference.com/wiki/_export/xhtml/tr/numeric/c/abs" />
18<link rel="alternate" type="text/plain" title="Wiki Markup" href="http://www.cppreference.com/wiki/_export/raw/tr/numeric/c/abs" />
19<link rel="canonical" href="abs" />
20<link rel="stylesheet" media="screen" type="text/css" href="../../../lib/exe/css.php@t=custom1&amp;tseed=1289693594" />
21<link rel="stylesheet" media="all" type="text/css" href="../../../lib/exe/css.php@s=all&amp;t=custom1&amp;tseed=1289693594" />
22<link rel="stylesheet" media="print" type="text/css" href="../../../lib/exe/css.php@s=print&amp;t=custom1&amp;tseed=1289693594" />
23<script type="text/javascript" ><!--//--><![CDATA[//><!--
24var NS='tr:numeric:c';var JSINFO = {"id":"tr:numeric:c:abs","namespace":"tr:numeric:c"};
25//--><!]]></script>
26<script type="text/javascript" charset="utf-8" src="../../../lib/exe/js.php@tseed=1289693594" ></script>
27</head>
28<body>
29<div class="dokuwiki export">
30
31<h2 class="sectionedit1"><a name="abs" id="abs">abs</a></h2>
32<div class="level2">
33
34<p>
35Söz dizimi:
36</p>
37<pre class="cpp code cpp">    <span class="co2">#include &lt;cstdlib&gt;</span>
38    <span class="kw4">int</span> <span class="kw3">abs</span><span class="br0">&#40;</span> <span class="kw4">int</span> num <span class="br0">&#41;</span><span class="sy4">;</span></pre>
39<p>
40
41abs() fonksiyonu num un kesin değerini döndürür. Örneğin:
42</p>
43<pre class="cpp code cpp">     <span class="kw4">int</span> sihirli_sayi <span class="sy1">=</span> <span class="nu0">10</span><span class="sy4">;</span>
44     <span class="kw3">cout</span> <span class="sy1">&lt;&lt;</span> <span class="st0">&quot;Bir tahmin gir: &quot;</span><span class="sy4">;</span>
45     <span class="kw3">cin</span> <span class="sy1">&gt;&gt;</span> x<span class="sy4">;</span>
46     <span class="kw3">cout</span> <span class="sy1">&lt;&lt;</span> <span class="st0">&quot;Tahmininiz &quot;</span> <span class="sy1">&lt;&lt;</span> <span class="st0">&quot;sihirli sayiya &quot;</span> <span class="sy1">&lt;&lt;</span> <span class="kw3">abs</span><span class="br0">&#40;</span> sihirli_sayi <span class="sy2">-</span> x <span class="br0">&#41;</span> <span class="sy1">&lt;&lt;</span> <span class="st0">&quot;kadar yaklasti. &quot;</span> <span class="sy1">&lt;&lt;</span> endl<span class="sy4">;</span></pre>
47<p>
48C++ aşağıdaki aşırı yüklenmiş biçimleri sağlar:
49
50</p>
51<pre class="cpp code cpp">    <span class="co2">#include &lt;cstdlib&gt;</span>
52    <span class="kw4">long</span> <span class="kw3">abs</span><span class="br0">&#40;</span> <span class="kw4">long</span> num <span class="br0">&#41;</span><span class="sy4">;</span> <span class="co1">// labs() benzeri</span>
53&nbsp;
54    <span class="co2">#include &lt;cmath&gt;</span>
55    <span class="co1">// fabs() eş anlamlısı</span>
56    <span class="kw4">float</span> <span class="kw3">abs</span><span class="br0">&#40;</span> <span class="kw4">float</span> num <span class="br0">&#41;</span><span class="sy4">;</span>
57    <span class="kw4">double</span> <span class="kw3">abs</span><span class="br0">&#40;</span> <span class="kw4">double</span> num <span class="br0">&#41;</span><span class="sy4">;</span>
58    <span class="kw4">long</span> <span class="kw4">double</span> <span class="kw3">abs</span><span class="br0">&#40;</span> <span class="kw4">long</span> <span class="kw4">double</span> num <span class="br0">&#41;</span><span class="sy4">;</span></pre>
59<p>
60İlgili başlıklar: <a href="http://www.cppreference.com/wiki/tr/numeric/c/fabs" class="wikilink2" title="tr:numeric:c:fabs" rel="nofollow">fabs</a>, <a href="http://www.cppreference.com/wiki/tr/numeric/c/labs" class="wikilink2" title="tr:numeric:c:labs" rel="nofollow">labs</a>
61</p>
62
63</div>
64<!-- EDIT1 SECTION "abs" [3-] --></div>
65</body>
66</html>