카타 8급 Function 2 - squaring an argument

Jmnote bot (토론 | 기여)님의 2020년 11월 2일 (월) 02:42 판 (봇: 자동으로 텍스트 교체 (-source +syntaxhighlight))
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 C[ | ]

#include <stdint.h>
int32_t square(int32_t n) {
  return n * n;
}
#include <stdint.h>
uint64_t square(int32_t number) {
  return (uint64_t)number * number;
}
#include <stdint.h>
#include <math.h>
int32_t square(int32_t n) {
  return pow(n,2);
}

2 JavaScript[ | ]

var square = function(n) {
  return n * n;
}
var square = function(n) {
  return Math.pow(n, 2);
}
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}