🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.programming
Article #5942

Kan java rekenen ?

#5942
From: jan bruggeman
Date: Wed, 19 Feb 2003 21:59
40 lines
2306 bytes
Beste,

Bij mij geeft volgend java programma:

import java.lang.Math;
public class Test {
        public static void main(String[] args) {
                System.out.println("Sinus of 00 = " + Math.sin(0d));
                System.out.println("Sinus of 30 = " + Math.sin(30d));
                System.out.println("Sinus of 60 = " + Math.sin(60d));
                System.out.println("Sinus of 90 = " + Math.sin(90d));
                System.out.println("Cos of 00 = " + Math.cos(0d));
                System.out.println("Cos of 30 = " + Math.cos(30d));
                System.out.println("Cos of 60 = " + Math.cos(60d));
                System.out.println("Cos of 90 = " + Math.cos(90d));
        }
}

volgende output:

[root@cook javaprog]# java Test
Sinus of 00 = 0.0
Sinus of 30 = -0.9880316240928618
Sinus of 60 = -0.3048106211022167
Sinus of 90 = 0.8939966636005579
Cos of 00 = 1.0
Cos of 30 = 0.15425144988758405
Cos of 60 = -0.9524129804151563
Cos of 90 = -0.4480736161291701

Er zijn veel rekenmachine's die daar anders over denken ... Where's the 
catch ?

nb: Ik probeerde het ook met door de waarden als 30.0e0 te schrijven, of 
door eerst een variabele van het type double te definieren en die te 
gebruiken in de berekening, altijd hetzelfde.

-- 
Jan Bruggeman
reply to: jan dot bruggeman at advalvas dot be
Technical Details
Message-ID: <3e53fd7c$0$23366$afc38c87@sisyphus.news.be.easynet.net>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!easynet-quince!easynet.net!feed1.news.be.easynet.net!sisyphus.news.be.easynet.net!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit
X-Google-Thread: fcea4,dcaf351d0f71681f,start
X-Google-Attributes: gidfcea4,public
X-Google-ArrivalTime: 2003-02-19 13:56:42 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!easynet-quince!easynet.net!feed1.news.be.easynet.net!sisyphus.news.be.easynet.net!not-for-mail
Message-ID: <3e53fd7c$0$23366$afc38c87@sisyphus.news.be.easynet.net>
From: jan bruggeman <ikke@hier.be>
Subject: Kan java rekenen ?
Newsgroups: be.comp.programming
Reply-To: ikke@hier.be
Date: Wed, 19 Feb 2003 22:59:00 +0100
User-Agent: KNode/0.7.1
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7Bit
Lines: 40
Organization: [ posted via Easynet Belgium ]
NNTP-Posting-Date: 19 Feb 2003 21:56:12 GMT
NNTP-Posting-Host: 213.193.166.122
X-Trace: 1045691772  23366 [::ffff:213.193.166.122]:63233
X-Complaints-To: abuse@be.easynet.net