This commit is contained in:
jfrijters 2006-02-13 16:41:14 +00:00
Родитель 09625c4fc3
Коммит 401b7aea0c
5 изменённых файлов: 147 добавлений и 113 удалений

Просмотреть файл

@ -689,6 +689,7 @@
../../classpath/gnu/java/security/jce/sig/DSSRawSignatureSpi.java
../../classpath/gnu/java/security/jce/sig/EncodedKeyFactory.java
../../classpath/gnu/java/security/jce/sig/KeyPairGeneratorAdapter.java
../../classpath/gnu/java/security/jce/sig/RSAKeyFactory.java
../../classpath/gnu/java/security/jce/sig/RSAKeyPairGeneratorSpi.java
../../classpath/gnu/java/security/jce/sig/RSAPSSRawSignatureSpi.java
../../classpath/gnu/java/security/jce/sig/SignatureAdapter.java
@ -708,7 +709,9 @@
../../classpath/gnu/java/security/key/rsa/GnuRSAPrivateKey.java
../../classpath/gnu/java/security/key/rsa/GnuRSAPublicKey.java
../../classpath/gnu/java/security/key/rsa/RSAKeyPairGenerator.java
../../classpath/gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.java
../../classpath/gnu/java/security/key/rsa/RSAKeyPairRawCodec.java
../../classpath/gnu/java/security/key/rsa/RSAKeyPairX509Codec.java
../../classpath/gnu/java/security/OID.java
../../classpath/gnu/java/security/pkcs/PKCS7SignedData.java
../../classpath/gnu/java/security/pkcs/SignerInfo.java
@ -921,11 +924,15 @@
../../classpath/gnu/javax/crypto/jce/prng/FortunaImpl.java
../../classpath/gnu/javax/crypto/jce/prng/ICMRandomSpi.java
../../classpath/gnu/javax/crypto/jce/prng/UMacRandomSpi.java
../../classpath/gnu/javax/crypto/jce/sig/DHKeyFactory.java
../../classpath/gnu/javax/crypto/jce/sig/DHKeyPairGeneratorSpi.java
../../classpath/gnu/javax/crypto/jce/spec/BlockCipherParameterSpec.java
../../classpath/gnu/javax/crypto/jce/spec/TMMHParameterSpec.java
../../classpath/gnu/javax/crypto/jce/spec/UMac32ParameterSpec.java
../../classpath/gnu/javax/crypto/key/BaseKeyAgreementParty.java
../../classpath/gnu/javax/crypto/key/dh/DHKeyPairPKCS8Codec.java
../../classpath/gnu/javax/crypto/key/dh/DHKeyPairRawCodec.java
../../classpath/gnu/javax/crypto/key/dh/DHKeyPairX509Codec.java
../../classpath/gnu/javax/crypto/key/dh/DiffieHellmanKeyAgreement.java
../../classpath/gnu/javax/crypto/key/dh/DiffieHellmanReceiver.java
../../classpath/gnu/javax/crypto/key/dh/DiffieHellmanSender.java
@ -3421,6 +3428,7 @@
../../classpath/javax/swing/table/TableModel.java
../../classpath/javax/swing/text/AbstractDocument.java
../../classpath/javax/swing/text/AbstractWriter.java
../../classpath/javax/swing/text/AsyncBoxView.java
../../classpath/javax/swing/text/AttributeSet.java
../../classpath/javax/swing/text/BadLocationException.java
../../classpath/javax/swing/text/BoxView.java
@ -4232,6 +4240,7 @@ java/lang/VMClass.java
java/lang/VMClassLoader.java
java/lang/VMDouble.java
java/lang/VMFloat.java
java/lang/VMMath.java
java/lang/VMRuntime.java
java/lang/VMSystem.java
java/lang/VMThread.java

Просмотреть файл

@ -530,7 +530,6 @@ public abstract class FileChannelImpl extends FileChannel
try
{
if(false) throw new cli.System.IO.IOException();
stream.Flush();
return stream.ReadByte();
}
catch(cli.System.IO.IOException x)
@ -557,7 +556,6 @@ public abstract class FileChannelImpl extends FileChannel
try
{
if(false) throw new cli.System.IO.IOException();
stream.Flush();
int count = stream.Read(buf, offset, len);
if(count == 0)
{

Просмотреть файл

@ -0,0 +1,136 @@
/*
Copyright (C) 2006 Jeroen Frijters
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Jeroen Frijters
jeroen@frijters.net
*/
package java.lang;
class VMMath
{
static double sin(double d)
{
return cli.System.Math.Sin(d);
}
static double cos(double d)
{
return cli.System.Math.Cos(d);
}
static double tan(double d)
{
return cli.System.Math.Tan(d);
}
static double asin(double d)
{
return cli.System.Math.Asin(d);
}
static double acos(double d)
{
return cli.System.Math.Acos(d);
}
static double atan(double d)
{
return cli.System.Math.Atan(d);
}
static double atan2(double y, double x)
{
if(cli.System.Double.IsInfinity(y) && cli.System.Double.IsInfinity(x))
{
if(cli.System.Double.IsPositiveInfinity(y))
{
if(cli.System.Double.IsPositiveInfinity(x))
{
return cli.System.Math.PI / 4.0;
}
else
{
return cli.System.Math.PI * 3.0 / 4.0;
}
}
else
{
if(cli.System.Double.IsPositiveInfinity(x))
{
return - cli.System.Math.PI / 4.0;
}
else
{
return - cli.System.Math.PI * 3.0 / 4.0;
}
}
}
return cli.System.Math.Atan2(y, x);
}
static double exp(double d)
{
return cli.System.Math.Exp(d);
}
static double log(double d)
{
return cli.System.Math.Log(d);
}
static double sqrt(double d)
{
return cli.System.Math.Sqrt(d);
}
static double pow(double x, double y)
{
if(cli.System.Math.Abs(x) == 1.0 && cli.System.Double.IsInfinity(y))
{
return Double.NaN;
}
return cli.System.Math.Pow(x, y);
}
static double IEEEremainder(double f1, double f2)
{
if(cli.System.Double.IsInfinity(f2) && !cli.System.Double.IsInfinity(f1))
{
return f1;
}
return cli.System.Math.IEEERemainder(f1, f2);
}
static double ceil(double d)
{
return cli.System.Math.Ceiling(d);
}
static double floor(double d)
{
return cli.System.Math.Floor(d);
}
static double rint(double d)
{
return cli.System.Math.Round(d);
}
}

Просмотреть файл

@ -22,6 +22,7 @@ gnu/java/nio/VMPipe.java
ikvm/internal/AnnotationAttributeBase.java
ikvm/internal/Library.java
ikvm/internal/LibraryVMInterface.java
ikvm/io/InputStreamWrapper.java
ikvm/lang/CIL.java
java/io/VMFile.java
java/io/VMObjectInputStream.java
@ -40,6 +41,7 @@ java/lang/VMClass.java
java/lang/VMClassLoader.java
java/lang/VMDouble.java
java/lang/VMFloat.java
java/lang/VMMath.java
java/lang/VMRuntime.java
java/lang/VMSystem.java
java/lang/VMThread.java

Просмотреть файл

@ -307,117 +307,6 @@ namespace IKVM.NativeCode.java
}
}
public class Math
{
public static double pow(double x, double y)
{
if(NetSystem.Math.Abs(x) == 1.0 && double.IsInfinity(y))
{
return double.NaN;
}
return NetSystem.Math.Pow(x, y);
}
public static double exp(double d)
{
return NetSystem.Math.Exp(d);
}
public static double rint(double d)
{
return NetSystem.Math.Round(d);
}
public static double IEEEremainder(double f1, double f2)
{
if(double.IsInfinity(f2) && !double.IsInfinity(f1))
{
return f1;
}
return NetSystem.Math.IEEERemainder(f1, f2);
}
public static double sqrt(double d)
{
return NetSystem.Math.Sqrt(d);
}
public static double floor(double d)
{
return NetSystem.Math.Floor(d);
}
public static double ceil(double d)
{
return NetSystem.Math.Ceiling(d);
}
public static double log(double d)
{
return NetSystem.Math.Log(d);
}
public static double sin(double d)
{
return NetSystem.Math.Sin(d);
}
public static double asin(double d)
{
return NetSystem.Math.Asin(d);
}
public static double cos(double d)
{
return NetSystem.Math.Cos(d);
}
public static double acos(double d)
{
return NetSystem.Math.Acos(d);
}
public static double tan(double d)
{
return NetSystem.Math.Tan(d);
}
public static double atan(double d)
{
return NetSystem.Math.Atan(d);
}
public static double atan2(double y, double x)
{
if(double.IsInfinity(y) && double.IsInfinity(x))
{
if(double.IsPositiveInfinity(y))
{
if(double.IsPositiveInfinity(x))
{
return NetSystem.Math.PI / 4.0;
}
else
{
return NetSystem.Math.PI * 3.0 / 4.0;
}
}
else
{
if(double.IsPositiveInfinity(x))
{
return - NetSystem.Math.PI / 4.0;
}
else
{
return - NetSystem.Math.PI * 3.0 / 4.0;
}
}
}
return NetSystem.Math.Atan2(y, x);
}
}
public class VMDouble
{
public static double parseDouble(string s)