mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 07:27:52 +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
|
@Override
|
||||||
protected void writeConst( Number value, ValueType valueType ) throws IOException {
|
protected void writeConst( Number value, ValueType valueType ) throws IOException {
|
||||||
newline( methodOutput );
|
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