JavaScript

[Math] JS - Math.fround() 메서드 - 최근접 32비트 단정밀도 부동소수 반환 (= Math.fround메서드 = 매스에프라운드메서드)

목차

  1. Math.fround() 예제 - 최근접 32비트 단정밀도 부동소수 반환
  2. Math.fround() 정의
  3. Math.fround() 구문

 

Math.fround() 예제 - 최근접 32비트 단정밀도 부동소수 반환

 

<p id="demo"></p>


<script>

let a = Math.fround(1.23); // 1.2300000190734863

let b = Math.fround(2.34); // 2.3399999141693115

let c = Math.fround(3.45); // 3.450000047683716

let d = Math.fround(-1.23); // -1.2300000190734863

let e = Math.fround(-2.34); // -2.3399999141693115

let f = Math.fround(-3.45); // -3.450000047683716

 

document.getElementById("demo").innerHTML =

a + "<br>" + b + "<br>" + c + "<br>" + d + "<br>" + e + "<br>" + f; 

</script>

 

결과보기

 

Math.fround() 정의

 

지정 숫자의 가장 가까운 32비트 단정밀도 부동 소수점 표현 반환.

 


 

 

1. cf.

 

2.

  • ECMAScript6(ES6: JavaScript 2015)
  • IE 제외한 주요 최신 브라우저 모두 지원.

 

3. MDN Math.fround() 예제보기

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround

 

 

Math.fround() 구문

 

Math.fround(x)

 


[매개변수]

 

x

필수. 숫자.

 


[반환값]

 

숫자의 최근접 32비트 단정밀도 부동 소수 반환.

 



분류 제목
DOM_Style JS - perspective -
DOM_Style JS - perspectiveOrigin -
DOM_Style JS - position 속성 - 위치기준대상지정 (= 위치속성 = 포지션속성 = position속성, 상속…
DOM_Style JS - quotes -
DOM_Style JS - resize 속성 - 사용자의 요소크기 조정가능여부 지정 (IE는 지원 X)
DOM_Style JS - right -
DOM_Style JS - tableLayout 속성 - 테이블 셀, 행 및 열을 레이아웃 (= table-layout속성 =…
DOM_Style JS - tabSize -
DOM_Style JS - textAlign 속성 ★ - 텍스트 가로/수평 정렬 (= 텍스트 좌측정렬/중앙정렬/우측정렬 = 텍…
DOM_Style JS - textAlignLast -
DOM_Style JS - textDecoration -
DOM_Style JS - textDecorationColor 속성 - 텍스트라인색깔 (= 텍스트데커레이션컬러속성, IE지원X…
DOM_Style JS - textDecorationLine 속성 - 텍스트라인위치 (윗줄,밑줄 등..) (= 텍스트데커레이션…
DOM_Style JS - textDecorationStyle 속성 - 텍스트라인모양 (굵은선, 파선, 점선, 물결선 등) (…
DOM_Style JS - textIndent 속성 - 텍스트 들여쓰기/내어쓰기 (= textIndent속성 = 텍스트인덴트속…
66/89
목록
 홈  PC버전 로그인 일본어
그누앞단언어
그누뒷단언어
그외코딩언어
그누보드
제작의뢰
Q&A
커뮤니티
웹유틸
회원센터
홈짱닷컴 PC버전 로그인