create account

c언어 절대값 구하기 abs() by wonnieyoon

View this thread on: hive.blogpeakd.comecency.com
· @wonnieyoon ·
$1.13
c언어 절대값 구하기 abs()
![](https://cdn.steemitimages.com/DQmdQmXukxicyaK5978LBB3rYq9RLYEJ7axRRFtjdwKJ1s1/image.png)

안녕하세요!! @wonnieyoon 입니다.
코딩을 하다보면 생각보다 절대값을 사용해야 하는 경우가 많습니다.
특히, 저의 경우 절대값을 주로 HTS 개발중 현재가를 가져와서 
데이터를 가공할때 사용합니다.
현재가 : -9999, +5000 이런식으로 오는데 -,+ 붙는 이유는 부호를 나타내기 위해서 내려옵니다.
현재가에 대해 이해가 안된다면 주식을 한번 해보는것을 추천!!

※ abs()
:절대값을 만들어주는 함수

※사용법
#include "stdafx.h"
#include <math.h>

int _tmain(int argc, _TCHAR* argv[])
{
	int a = -3;
	printf("%d\n", abs(a));
	
}

※결과
3
👍  , , , , , , , , , , , , , , , , , ,
properties (23)
authorwonnieyoon
permlinkc-abs
categorykr-dev
json_metadata{"tags":["kr-dev","kr-science","kr","jjangjjangman","include"],"users":["wonnieyoon"],"image":["https://cdn.steemitimages.com/DQmdQmXukxicyaK5978LBB3rYq9RLYEJ7axRRFtjdwKJ1s1/image.png"],"app":"steemit/0.1","format":"markdown"}
created2018-07-24 15:15:18
last_update2018-07-24 15:15:18
depth0
children3
last_payout2018-07-31 15:15:18
cashout_time1969-12-31 23:59:59
total_payout_value0.904 HBD
curator_payout_value0.224 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length461
author_reputation5,521,302,527,816
root_title"c언어 절대값 구하기 abs()"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id65,826,055
net_rshares539,040,583,392
author_curate_reward""
vote details (19)
@steemitboard ·
Congratulations @wonnieyoon! You have received a personal award!

[![](https://steemitimages.com/70x70/http://steemitboard.com/@wonnieyoon/birthday1.png)](http://steemitboard.com/@wonnieyoon)  1 Year on Steemit
<sub>_Click on the badge to view your Board of Honor._</sub>


> Do you like [SteemitBoard's project](https://steemit.com/@steemitboard)? Then **[Vote for its witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1)** and **get one more award**!
properties (22)
authorsteemitboard
permlinksteemitboard-notify-wonnieyoon-20180801t004459000z
categorykr-dev
json_metadata{"image":["https://steemitboard.com/img/notify.png"]}
created2018-08-01 00:45:00
last_update2018-08-01 00:45:00
depth1
children0
last_payout2018-08-08 00:45:00
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length494
author_reputation38,975,615,169,260
root_title"c언어 절대값 구하기 abs()"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id66,697,378
net_rshares0
@steemitboard ·
Congratulations @wonnieyoon! You received a personal award!

<table><tr><td>https://steemitimages.com/70x70/http://steemitboard.com/@wonnieyoon/birthday2.png</td><td>Happy Birthday! - You are on the Steem blockchain for 2 years!</td></tr></table>

<sub>_You can view [your badges on your Steem Board](https://steemitboard.com/@wonnieyoon) and compare to others on the [Steem Ranking](https://steemitboard.com/ranking/index.php?name=wonnieyoon)_</sub>


###### [Vote for @Steemitboard as a witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1) to get one more award and increased upvotes!
properties (22)
authorsteemitboard
permlinksteemitboard-notify-wonnieyoon-20190731t234327000z
categorykr-dev
json_metadata{"image":["https://steemitboard.com/img/notify.png"]}
created2019-07-31 23:43:27
last_update2019-07-31 23:43:27
depth1
children0
last_payout2019-08-07 23:43:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length628
author_reputation38,975,615,169,260
root_title"c언어 절대값 구하기 abs()"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id88,992,881
net_rshares0
@virus707 ·
(jjangjjangman 태그 사용시 댓글을 남깁니다.)
[제 0회 짱짱맨배 42일장]4주차 보상글추천, 1,2,3주차 보상지급을 발표합니다.(계속 리스팅 할 예정)
https://steemit.com/kr/@virus707/0-42-4-1-2-3

4주차에 도전하세요

그리고 즐거운 스티밋하세요!

👍  
properties (23)
authorvirus707
permlinkre-wonnieyoon-c-abs-1532529364946tc5754da0-68c8-4969-80f2-b7792cd35111uid
categorykr-dev
json_metadata{"tags":["support"],"users":["virus707"],"links":["https://steemit.com/kr/@virus707/0-42-4-1-2-3"],"app":"null/null","format":"markdown"}
created2018-07-25 14:36:12
last_update2018-07-25 14:36:12
depth1
children0
last_payout2018-08-01 14:36:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length170
author_reputation557,563,606,581,756
root_title"c언어 절대값 구하기 abs()"
beneficiaries
0.
accountsteemj
weight250
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id65,938,599
net_rshares152,846,028
author_curate_reward""
vote details (1)