mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 10:44:47 +01:00
floating point numbers must written with hexadecimal literals
This commit is contained in:
parent
decfdf77f1
commit
3095f29f3d
@ -240,7 +240,18 @@ public class TextModuleWriter extends ModuleWriter {
|
||||
@Override
|
||||
protected void writeConst( Number value, ValueType valueType ) throws IOException {
|
||||
newline( methodOutput );
|
||||
methodOutput.append( valueType ).append( ".const " ).append( value );
|
||||
methodOutput.append( valueType ).append( ".const " );
|
||||
switch( valueType ) {
|
||||
case f32:
|
||||
methodOutput.append( Float.toHexString( value.floatValue() ) ).append( " ;;" ).append( value );
|
||||
break;
|
||||
case f64:
|
||||
methodOutput.append( Double.toHexString( value.doubleValue() ) ).append( " ;;" ).append( value );
|
||||
break;
|
||||
default:
|
||||
methodOutput.append( value );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user