mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 07:27:52 +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 " );
|
methodOutput.append( valueType ).append( ".const " );
|
||||||
switch( valueType ) {
|
switch( valueType ) {
|
||||||
case f32:
|
case f32:
|
||||||
methodOutput.append( Float.toHexString( value.floatValue() ) ).append( " ;;" ).append( value );
|
methodOutput.append( Float.toHexString( value.floatValue() ).toLowerCase() ).append( " ;;" ).append( value );
|
||||||
break;
|
break;
|
||||||
case f64:
|
case f64:
|
||||||
methodOutput.append( Double.toHexString( value.doubleValue() ) ).append( " ;;" ).append( value );
|
methodOutput.append( Double.toHexString( value.doubleValue() ).toLowerCase() ).append( " ;;" ).append( value );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
methodOutput.append( value );
|
methodOutput.append( value );
|
||||||
|
@ -64,6 +64,8 @@ public class MathOperations extends AbstractBaseTest {
|
|||||||
addParam( list, script, "shortInc", (short)-32768 );
|
addParam( list, script, "shortInc", (short)-32768 );
|
||||||
addParam( list, script, "charOp", (char)0xFFFF );
|
addParam( list, script, "charOp", (char)0xFFFF );
|
||||||
addParam( list, script, "castNumberOverflow" );
|
addParam( list, script, "castNumberOverflow" );
|
||||||
|
addParam( list, script, "doubleNaN" );
|
||||||
|
addParam( list, script, "floatNaN" );
|
||||||
}
|
}
|
||||||
rule.setTestParameters( list );
|
rule.setTestParameters( list );
|
||||||
return list;
|
return list;
|
||||||
@ -291,5 +293,15 @@ public class MathOperations extends AbstractBaseTest {
|
|||||||
|
|
||||||
return result;
|
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