1
0
Fork 0

Input NaN & Inf into FPU registers

This commit is contained in:
torusrxxx 2018-07-02 12:09:01 +08:00 committed by Duncan Ogilvie
parent fa82c80c51
commit 8ab605b7f6
2 changed files with 6 additions and 2 deletions

View File

@ -76,7 +76,9 @@ void LineEditDialog::on_textEdit_textChanged(const QString & arg1)
editText = arg1;
if(this->fixed_size != 0)
{
if(arg1.size() != this->fixed_size && (!fpuMode || !arg1.contains(QChar('.'))))
QString arg1Lower = arg1.toLower();
if(arg1.size() != this->fixed_size && (!fpuMode || !(arg1.contains(QChar('.')) || arg1Lower == "inf" || arg1Lower == "nan" || arg1Lower == "+inf" || arg1Lower == "-inf")))
//TODO: QNaN & SNaN
{
ui->buttonOk->setEnabled(false);
QString symbolct = "";

View File

@ -2638,7 +2638,9 @@ void RegistersView::displayEditDialog()
fpuvalue = mLineEdit.editText.toUInt(&ok, 16);
else if(mFPUx87_80BITSDISPLAY.contains(mSelected))
{
if(sizeRegister == 10 && mLineEdit.editText.contains(QChar('.')))
QString editTextLower = mLineEdit.editText.toLower();
if(sizeRegister == 10 && (mLineEdit.editText.contains(QChar('.')) || editTextLower == "nan" || editTextLower == "inf"
|| editTextLower == "+inf" || editTextLower == "-inf"))
{
char number[10];
str2ld(mLineEdit.editText.toUtf8().constData(), number);