JavaScript Math.fround()
ဥပမာ
let a = Math.fround(2.60);
let b = Math.fround(2.50);
let c = Math.fround(2.49);
let d = Math.fround(-2.60);
let e = Math.fround(-2.50);
let f = Math.fround(-2.49);
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
Math.fround() method သည် ဂဏန်းတစ်ခု၏ အနီးဆုံး (32-bit single precision) float ကိုယ်စားပြုမှုကို ပြန်ပေးသည်။
Browser ပံ့ပိုးမှု
Math.fround()
ECMAScript6 (ES6) အင်္ဂါရပ်တစ်ခုဖြစ်သည်။
ES6 (JavaScript 2015) ကို ခေတ်မီဘရောက်ဆာများအားလုံးတွင် ပံ့ပိုးထားပါသည်။
Chrome | Edge | Firefox | Safari | Opera |
Yes | Yes | Yes | Yes | Yes |
Math.fround()
Internet Explorer 11 (သို့မဟုတ်အစောပိုင်း) တွင် မပံ့ပိုးပါ။
အထားအသို
Math.fround(x)
ကန့်သတ်ချက်များ
Parameter | Description |
---|---|
x | Required. A number |
တန်ဖိုးကို ပြန်ပေးသည်။
thr နံပါတ်၏ အနီးဆုံး 32-bit တစ်ခုတည်းတိကျသော float ကိုယ်စားပြုမှု။ |