teavm-javac
teavm-javac copied to clipboard
double to string
Compiling the following code
public class Main {
public static void main(String[] args){
System.out.println(1.0);
}
}
produces the following error with the latest master
ERROR at Main.java:4 Native method java.lang.Double.doubleToLongBits(D)J has no implementation
at java.lang.Double.doubleToLongBits
at org.teavm.classlib.impl.text.DoubleAnalyzer.analyze(DoubleAnalyzer.java:76)
at java.lang.AbstractStringBuilder.insert(TAbstractStringBuilder.java:351)
at java.lang.AbstractStringBuilder.append(TAbstractStringBuilder.java:309)
at java.lang.StringBuilder.append(TStringBuilder.java:61)
at java.io.PrintStream.println(TPrintStream.java:197)
@konsoletyper For some reason, it's working fine at http://teavm.org/sandbox/index.html. I could copy the library directly from there but I do not have source file to modify it. If only there's a source code version of that sandbox, that would be great.
@konsoletyper System.out.println(1f); Also output as NaN on both version.
I ran into this issue too. I ended up cloning and installing @frankbauer's fork of TeaVM itself (had to change teavm.version
in the teavm-javac
root pom.xml
to 0.6.0-for-javac-107
to use that local build instead of the remote one).