Appearance
DecimalArithmetic
整数からDecimalを実行時生成し、(10 + 2) × 3 - 5を2で割る加減乗除を行います。計算式とDecimal結果15.5をログへ出力します。
json
{
"version": 1,
"comment": "整数からDecimalを実行時生成し、(10 + 2) × 3 - 5を2で割る加減乗除を行います。計算式とDecimal結果15.5をログへ出力します。",
"data": [
{
"name": "__int10",
"type": "SystemInt32",
"value": 10
},
{
"name": "__int2",
"type": "SystemInt32",
"value": 2
},
{
"name": "__int3",
"type": "SystemInt32",
"value": 3
},
{
"name": "__int5",
"type": "SystemInt32",
"value": 5
},
{
"name": "__decimal10",
"type": "SystemDecimal",
"value": null
},
{
"name": "__decimal2",
"type": "SystemDecimal",
"value": null
},
{
"name": "__decimal3",
"type": "SystemDecimal",
"value": null
},
{
"name": "__decimal5",
"type": "SystemDecimal",
"value": null
},
{
"name": "__sum",
"type": "SystemDecimal",
"value": null
},
{
"name": "__product",
"type": "SystemDecimal",
"value": null
},
{
"name": "__difference",
"type": "SystemDecimal",
"value": null
},
{
"name": "__result",
"type": "SystemDecimal",
"value": null
},
{
"name": "__expression",
"type": "SystemString",
"value": "((10 + 2) * 3 - 5) / 2 = "
},
{
"name": "__message",
"type": "SystemString",
"value": ""
}
],
"code": [
{
"name": "Calculate",
"export": true,
"instructions": [
{
"op": "PUSH",
"operand": "__int10"
},
{
"op": "EXTERN",
"signature": "SystemConvert.__ToDecimal__SystemInt32__SystemDecimal",
"argumentCount": 1,
"return": "__decimal10"
},
{
"op": "POP"
},
{
"op": "PUSH",
"operand": "__int2"
},
{
"op": "EXTERN",
"signature": "SystemConvert.__ToDecimal__SystemInt32__SystemDecimal",
"argumentCount": 1,
"return": "__decimal2"
},
{
"op": "POP"
},
{
"op": "PUSH",
"operand": "__int3"
},
{
"op": "EXTERN",
"signature": "SystemConvert.__ToDecimal__SystemInt32__SystemDecimal",
"argumentCount": 1,
"return": "__decimal3"
},
{
"op": "POP"
},
{
"op": "PUSH",
"operand": "__int5"
},
{
"op": "EXTERN",
"signature": "SystemConvert.__ToDecimal__SystemInt32__SystemDecimal",
"argumentCount": 1,
"return": "__decimal5"
},
{
"op": "POP"
},
{
"op": "PUSH",
"operand": "__decimal10"
},
{
"op": "PUSH",
"operand": "__decimal2"
},
{
"op": "EXTERN",
"signature": "SystemDecimal.__op_Addition__SystemDecimal_SystemDecimal__SystemDecimal",
"argumentCount": 2,
"return": "__sum"
},
{
"op": "POP"
},
{
"op": "PUSH",
"operand": "__sum"
},
{
"op": "PUSH",
"operand": "__decimal3"
},
{
"op": "EXTERN",
"signature": "SystemDecimal.__op_Multiply__SystemDecimal_SystemDecimal__SystemDecimal",
"argumentCount": 2,
"return": "__product"
},
{
"op": "POP"
},
{
"op": "PUSH",
"operand": "__product"
},
{
"op": "PUSH",
"operand": "__decimal5"
},
{
"op": "EXTERN",
"signature": "SystemDecimal.__op_Subtraction__SystemDecimal_SystemDecimal__SystemDecimal",
"argumentCount": 2,
"return": "__difference"
},
{
"op": "POP"
},
{
"op": "PUSH",
"operand": "__difference"
},
{
"op": "PUSH",
"operand": "__decimal2"
},
{
"op": "EXTERN",
"signature": "SystemDecimal.__op_Division__SystemDecimal_SystemDecimal__SystemDecimal",
"argumentCount": 2,
"return": "__result"
},
{
"op": "POP"
},
{
"op": "PUSH",
"operand": "__expression"
},
{
"op": "PUSH",
"operand": "__result"
},
{
"op": "EXTERN",
"signature": "SystemString.__Concat__SystemObject_SystemObject__SystemString",
"argumentCount": 2,
"return": "__message"
},
{
"op": "EXTERN",
"signature": "UnityEngineDebug.__Log__SystemObject__SystemVoid",
"argumentCount": 1
}
]
}
]
}