private static string HandleFloatMath(string op, string c0, string c1, TokenType c0_t, TokenType c1_t) { double d_c0 = ParseDouble(c0); double d_c1 = ParseDouble(c1); string term = c0.Last().ToString(); if (char.IsDigit(term[0])) { term = "d"; } else { if (term != "d") { term = c1.Last().ToString(); if (char.IsDigit(term[0])) { term = "d"; } } } return(NumberMath.HandleBinaryMath(op, d_c0, d_c1).ToString() + term); }
private static string HandleNumberMath(string op, string c0, string c1, TokenType c0_t, TokenType c1_t) { ulong hex_c0 = 0; ulong hex_c1 = 0; bool neg_c0 = false; bool neg_c1 = false; ParseNum(c0, c0_t, out hex_c0, out neg_c0); ParseNum(c1, c1_t, out hex_c1, out neg_c1); ulong r_val = NumberMath.HandleBinaryMath(op, hex_c0, hex_c1, neg_c0, neg_c1, out bool r_sgn); if (r_sgn) { return("-" + r_val.ToString()); } else { return(r_val.ToString()); } }