1 страниц (5 вхождений)
Bug with Mod? - Сообщения
#1 Опубликовано: 01.01.2021 11:11:36
I had encountered a strange behavior while trying to implement Tupper Formula.
Is this a bug or SMath shouldn't calculate modular of such a long number?
Sorry for very big picture but don't know how to show it in here else.
Build 0.99.7666 on Linux, same result with previous old builds by the way.
Regards
tupper.sm (4 КиБ) скачан 24 раз(а).

Is this a bug or SMath shouldn't calculate modular of such a long number?
Sorry for very big picture but don't know how to show it in here else.
Build 0.99.7666 on Linux, same result with previous old builds by the way.
Regards
tupper.sm (4 КиБ) скачан 24 раз(а).
#2 Опубликовано: 01.01.2021 13:54:02
SMath doesn't have exact integer arithmetics. Numbers are handled as floats with finite precision. You will find that k+1=k evaluates to true. If you want to do exact integer arithmetics, Unfortunately, you can't even use CAS plugins like maxima or maple because any input is handled by SMath first before conveying it to the plugin. This includes downgrading of numeric constants to IEEE 754 floats.
Maxima has a mechanism of using string input to circumvent this but this will look extremly ugly in the SMath sheet.
tupper_kr.sm (4 КиБ) скачан 24 раз(а).
![2021-01-01 17_52_19-SMath Studio - [tupper.sm_].png](/ru-RU/file/BEXEPE/2021-01-01-17_52_19-SMath-Studio---_tupper_sm___png)
Maxima has a mechanism of using string input to circumvent this but this will look extremly ugly in the SMath sheet.
tupper_kr.sm (4 КиБ) скачан 24 раз(а).
Martin Kraska
Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
#3 Опубликовано: 01.01.2021 19:20:14
WroteIs this a bug or SMath shouldn't calculate modular of such a long number?
"modular" ... you mean 'mod'
Write ... mod(k,1.23456789)
Write ... mod(k,123456789.987654321)
#4 Опубликовано: 02.01.2021 10:51:59
WroteSMath doesn't have exact integer arithmetics. Numbers are handled as floats with finite precision.
Thanks Martin, I figured so.
This is why there is a question, "bug or not".
Clearly it is not a bug but how SMath works.
Regards
#5 Опубликовано: 02.01.2021 20:08:42
WroteThis is why there is a question, "bug or not".
Nothing new here. I posted the attached long time ago, no answer.
Too big numbers chokes Smath.
Critical error.sm (2 КиБ) скачан 21 раз(а).
1 страниц (5 вхождений)
-
Новые сообщения
-
Нет новых сообщений