____  ___    _  _     _   _ _____     _______
 / ___|/ _ \  | || |   | | | |_ _\ \   / / ____|
| |  _| | | | | || |_  | |_| || | \ \ / /|  _|
| |_| | |_| | |__   _| |  _  || |  \ V / | |___
 \____|\___/     |_|   |_| |_|___|  \_/  |_____|

 --- A GOPHER-LIKE INTERFACE FOR HIVE BLOCKCHAIN ---

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

BY: @wonnieyoon | CREATED: July 24, 2018, 3:15 p.m. | VOTES: 19 | PAYOUT: $1.13 | [ VOTE ]

[IMAGE: https://cdn.steemitimages.com/DQmdQmXukxicyaK5978LBB3rYq9RLYEJ7axRRFtjdwKJ1s1/image.png]

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

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

※사용법

include "stdafx.h"

include

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

}

※결과
3

TAGS: [ #kr-dev ] [ #kr-science ] [ #kr ] [ #jjangjjangman ] [ #include ]

Replies

@virus707 | July 25, 2018, 2:36 p.m. | Votes: 1 | [ VOTE ]

(jjangjjangman 태그 사용시 댓글을 남깁니다.)
[제 0회 짱짱맨배 42일장]4주차 보상글추천, 1,2,3주차 보상지급을 발표합니다.(계속 리스팅 할 예정)
https://steemit.com/kr/@virus707/0-42-4-1-2-3

4주차에 도전하세요

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

@steemitboard | Aug. 1, 2018, 12:45 a.m. | Votes: 0 | [ VOTE ]

Congratulations @wonnieyoon! You have received a personal award!

[IMAGE: https://steemitimages.com/70x70/http://steemitboard.com/@wonnieyoon/birthday1.png] 1 Year on Steemit
Click on the badge to view your Board of Honor.

> Do you like SteemitBoard's project? Then Vote for its witness and get one more award!

@steemitboard | July 31, 2019, 11:43 p.m. | Votes: 0 | [ VOTE ]

Congratulations @wonnieyoon! You received a personal award!

https://steemitimages.com/70x70/http://steemitboard.com/@wonnieyoon/birthday2.pngHappy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!
[ BACK TO TRENDING ] [ BACK TO MENU ]
CMD>