Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
Math.abs()
Bu kod verilen sayının mutlak değer olarak değerini verirMutlak değer demek sayının
0 noktasına olan uzaklığıdır. Örneğin:
*/
Math.abs(-17); //17 sonucunu verir..
var sayi1=-56;
trace(Math.abs(sayi1));//56sonucunu verir..
/*
Math.ceil()
Bu kod verilen ondalık sayıyı bir üst tamsayıya(+∞’a doğru) yuvarlar.
*/
trace(Math.ceil(-2.3));//-2 sonucunu verir..
trace(Math.ceil(2.3));//3 sonucunu verir.
/*
Math.floor()
Bu kod verilen ondalık sayıyı bir alt tamsayıya(-∞’a doğru) yuvarlar.
*/
trace(Math.floor(-1.3));//-2
trace(Math.floor(2.3));//2
/*
Math.round()
Round() komudu verilen sayiyi en yakın tamsayıya yuvarlar. Eğer sayı iki tarafa da eşit uzaklıktaysa örneğin 10.5 gibi sayıyı üste 11’e yuvarlar.
*/
trace(Math.round(10.4));//10 sonucunu verir..
trace(Math.round(10.8));//11 sonucunu verir..
/*
Math.max(sayi3,sayi4)
Bu kod verilen 2 sayıdan büyük olanı verir..
*/
trace(Math.max(19,15));//19 sonucunu verir
var sayi3=22;
var sayi4=13;
trace(Math.max(sayi3,sayi4));//22 sonucunu verir...
/*
Math.min(sayi5,sayi6)
Bu kod verilen 2 sayıdan küçük olanı verir..
*/
var sayi5=11;
var sayi6=10;
trace(Math.min(sayi5,sayi6));//10 sonucunu verir..
/*
Math.pow(sayi,sayının_üssü)
Pow() fonksiyonu da tahmin edebileceğiniz gibi ilk sayı üssü ikinci sayıyı hesaplayıp sonucunu verir..
*/
trace(Math.pow(10,2));//100 sonucunu verir..
var sayi7=3;
var sayi8=2;
trace(Math.pow(sayi7,sayi8));//9 sonucunu verir..
/*
Math.sqrt()
Sqrt() kodu yazılan sayının karekökünü alır.
*/
trace(Math.sqrt(9));//3 sonucunu verir.
/*
Math.PI()
Bu sonuç size her zaman sabit bir sayı olan PI sabitini verir.PI sabiti her çemberin
çevresinin kendi yarıçapına oranıdır.Yani bütün çemberlerin çevrelerinin yarıçapına oranı sabittir.
*/
var sayi=Math.PI;
trace(sayi);//3.141592653589793 sonucunu verir.
/*
Math.cos()
Trigonometride herhangi bir açının cosinus değerini verir.
*/
var deger=Math.cos(0);
trace(deger);//sonucu 1 olarak verir.
/*
Math.random() 0-1 arasında sayı üretir
*/
trace(Math.random()); //0-1 arası sayı üretti
trace(Math.random()*100); //0-100 arası ondalıklı sayı
trace(Math.round((Math.random()*100)));//0-100 arası tam sayı üretir
trace(Math.round((Math.random()*100+50)));//50-150 arası tam sayı üretir
sayiUret.addEventListener(MouseEvent.CLICK, uret);
function uret(event:MouseEvent):void
{
xx.text=Math.round(Math.random()*377).toString();
yy.text=Math.round(Math.random()*277).toString();
daire.x=Number(xx.text);
daire.y=Number(yy.text);
}
b1.addEventListener(MouseEvent.CLICK, yukari);
function yukari(event:MouseEvent):void
{
sekil.y-=15;
}
b2.addEventListener(MouseEvent.CLICK, asagi);
function asagi(event:MouseEvent):void
{
sekil.y+=15;
}
b3.addEventListener(MouseEvent.CLICK, sola);
function sola(event:MouseEvent):void
{
sekil.x-=15;
}
b4.addEventListener(MouseEvent.CLICK, saga);
function saga(event:MouseEvent):void
{
sekil.x+=15;
}
bsag.addEventListener(MouseEvent.CLICK, sagadon);
function sagadon(event:MouseEvent):void
{
sekil.rotation += 25;
}
bsol.addEventListener(MouseEvent.CLICK, soladon);
function soladon(event:MouseEvent):void
{
sekil.rotation -= 25;
}
buyu.addEventListener(MouseEvent.CLICK, buyult);
function buyult(event:MouseEvent):void
{
sekil.width*=1.1;
sekil.height*=1.1;
}
kucul.addEventListener(MouseEvent.CLICK, kucult);
function kucult(event:MouseEvent):void
{
sekil.width/=1.1;
sekil.height/=1.1;
}
function islem(ilk:int,son:int,bolen1:int,bolen2:int):void
{
var sayac:int=0;
var toplam:int=0;
for(var i:int=ilk;i<=son;i++)
{
if(i%bolen1==0 && i%bolen2==0)
{
trace(i);
sayac++;
toplam+=i;
}
}
trace(bolen1+" ve "+ bolen2+ " sayılarına tam bölünen sayı miktarı="+sayac);
trace("BÖlünen sayıların toplamı="+toplam);
}
islem(5,100,2,3);
function islem(a:int,b:int,isaret:String):void
{
var a1:int;
if(isaret == "+")
{
a1=a+b;
}
else if(isaret == "-")
{
a1=a-b;
}
else if(isaret == "/")
{
a1=a/b;
}
else if(isaret == "*")
{
a1=a*b;
}
else if(isaret == "ort")
{
a1=(a+b)/2;
}
else
{
trace("Yanlış Bilgi Girdiniz");
}
trace("İki Sayının toplamı/bölümü/çarpım/çıkarımı/ortalaması sonucu="+a1);
}
islem(5,5,"ort");
function bol(a1:int,a2:int,a3:int):void
{
var sonuc:int=0;
for(var i:int=a1;i<=a2;i++)
{
sonuc+=i;
if(sonuc%a3==0)
{
trace(sonuc);
}
}
}
bol(20,25,11);
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team