mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 02:44:47 +01:00
NaN is written in lowercase in Wasm text format.
This commit is contained in:
parent
588ac6db47
commit
abeec6cca4
@ -386,10 +386,10 @@ public class TextModuleWriter extends ModuleWriter {
|
||||
methodOutput.append( valueType ).append( ".const " );
|
||||
switch( valueType ) {
|
||||
case f32:
|
||||
methodOutput.append( Float.toHexString( value.floatValue() ) ).append( " ;;" ).append( value );
|
||||
methodOutput.append( Float.toHexString( value.floatValue() ).toLowerCase() ).append( " ;;" ).append( value );
|
||||
break;
|
||||
case f64:
|
||||
methodOutput.append( Double.toHexString( value.doubleValue() ) ).append( " ;;" ).append( value );
|
||||
methodOutput.append( Double.toHexString( value.doubleValue() ).toLowerCase() ).append( " ;;" ).append( value );
|
||||
break;
|
||||
default:
|
||||
methodOutput.append( value );
|
||||
|
@ -64,6 +64,8 @@ public class MathOperations extends AbstractBaseTest {
|
||||
addParam( list, script, "shortInc", (short)-32768 );
|
||||
addParam( list, script, "charOp", (char)0xFFFF );
|
||||
addParam( list, script, "castNumberOverflow" );
|
||||
addParam( list, script, "doubleNaN" );
|
||||
addParam( list, script, "floatNaN" );
|
||||
}
|
||||
rule.setTestParameters( list );
|
||||
return list;
|
||||
@ -291,5 +293,15 @@ public class MathOperations extends AbstractBaseTest {
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Export
|
||||
static double doubleNaN() {
|
||||
return Double.NaN;
|
||||
}
|
||||
|
||||
@Export
|
||||
static float floatNaN() {
|
||||
return Float.NaN;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user