Calc+

...
  • отличная работа!
    Почему используется win_face вместо btn_face, win_text вместо btn_text.
    Таки прошу переделать потом на системные цвета, сейчас такой цвет кнопок связан со скином, если там изменить цвета , то calc , fasm, kpack и прочие программы будут иметь невнятные плохо видимые кнопки... Прошу потерпеть, все сразу не делается - но не пилить сразу не по стандарту )))
  • Calc+ v0.2β
    • Полная поддержка (целочисленная) оператора "^" (возведения в степень) по правилам:

      Code: Select all

      -x^n == -(x^n)
      x^n^m == x^(n^m) 
    • Оптимизация. Окно больше не перерисовывается при любом изменении.
    • Изменена скорость ответа парсера.
    • Множественные багфиксы в парсере.
    • Парсер выдаёт ошибку при: (отсутствии нужного)/(наличии лишнего) оператора "(" или ")", при наличии неизвестного или неуместного символа (например "2+*3" выдаст ошибку "Input error")
    Attachments
    calcplus.7z (4.42 KiB)
    сорцы + бинарник
    Downloaded 367 times
  • -x^n == -(x^n)
    Тут могут быть проблемы с написанием формул. Например можно написать -1^2 и иметь в виду (-1)^2=-1*-1=1, а не -(1^2)
  • Wildwest wrote:
    -x^n == -(x^n)
    Тут могут быть проблемы с написанием формул. Например можно написать -1^2 и иметь в виду (-1)^2=-1*-1=1, а не -(1^2)
    Я руководствуюсь не какими то своими принципами, а конкретными правилами математики. Можно проверить "-2^2" в других калькуляторах, и там тоже будет ответ -4. Например в гугле. Если нужно возвести в квадрат -2, то нужно брать в скобки. На уроках математики нас так и учили.
    Вот полезная инфа от buyerninety:
    B O D M A S
    Brackets (or Parentheses), Of (or Order of, or Indices, or Exponents), Division and Multiplication (equal precedence,
    so work from left to right), Addition and Subtraction (equal precedence, so work from left to right)

    (Some mathematical equations may give you the same answer even if you don't follow order of operations,
    e.g. 1+(5x81)/9 gives same answer as 1+5x(81/9) , both cases = 46

    Most mathematical equations, though, you need to follow the order of operations)
    6÷2(1+2)=9 , not 1
    10/2x4-5x6=-10 , not 90
    15/(12+3(6-8))=2.5 , not 1.1538...

    Negative Numbers;
    neg x neg = pos , except in cases where zero is involved, e.g. -1 x 0 = 0
    neg x neg x neg = neg

    8 / -2 = -4
    -16 /4 = -4
    -7 x 3 / -1 = -21/-1 = 21

    Pos / Neg = Neg
    Neg / Pos = Neg
    Neg / Neg = Pos
    Pos / Pos = Pos

    why is a neg divided by a neg a pos?
    because it goes into it a positive number of times like -4 goes into -12 three times, right?
    can also be said that, because the negatives cancel out, leaving it with a positive

    if you divide or multiply negative numbers 2 times like this :
    -3 x -8 x -2 will the negatives cancel out into positives?
    The first two will cancel, then the third will turn the final answer to a negative.
    -3 times -8 is +24 , +24 times -2 is -48.

    Dividing Involving Zero;
    5 / 5 = 1 , 0 / -5 = 0 , -5 / 0 = undefined , 0/0 = undefined
    You see, if you do 0/5, it would be 0 because 0 x 5 = 0. Yet if you do 5/0 it would be undefined because
    no matter what you try to multiply by 0 to get 5, you always get 0.

    But why is it that 0 divided by 0 be undefined!? shouldn't it be 1? because if you ask yourself how many times
    does 0 go into 0 would it be 1? Surely this is the basic rules of division that say "a number that goes into itself
    will always be 1"? (but does this not apply for zero?)
    Several people stated that dividing by 0 is undefined, which is correct. However, take n/n, where n is not 0.
    It is always 1 and, thus, makes 0/0 seems like it should be 1.
    On the other hand, take 0/n, where n is not 0. It is always 0 and, thus, makes 0/0 seems like it should be 0.
    It can't be both 1 and 0, so it cannot be determined consistently: therefore the actual convention is: 'undefined' .

    Differing Conventions (!) in computer programs!! (take as only one example!);
    There exist differing conventions concerning the unary operator - (usually read "minus"). In written or printed
    mathematics, the expression -3^2 is interpreted to mean -(3^2) = -9, but in some applications and programming
    languages, notably BASIC programming language, the application Microsoft Office Excel and the programming
    language 'bc', unary operators have a higher priority than binary operators, that is, the unary minus (negation) has
    higher precedence than exponentiation, so in those languages -3^2 will be interpreted as (-3)^2 = 9
    .
    На самом деле это фича, так как мне пришлось писать целых уровень парсинга ради этого.
  • Пример калькулятора, который дает другой результат

    http://www.calculator888.ru/

    -1^2=1
  • Wildwest wrote:Пример калькулятора, который дает другой результат

    http://www.calculator888.ru/

    -1^2=1
    Не забывай, что там не калькулятор выражений. Мало того, я больше доверяю гуглу). Стандартный калькулятор выражений на телефоне и на пк говорит, что -2^2=-4. Вообщем, спорный вопрос. Как написано в тексте в моём предыдущем посте, -2^2=-4 - математически правильно.
  • -2^2 = 4 (-2*-2 = 4) -2^2 = -4 математически не верно...квадратный корень из -4 не равен -2. Возможно вы имеете ввиду -1*(2)^2 тогда да -4...
  • Calc+ v0.3β
    • Добавлена поддержка функций
    • Добавлены функции inc(n), dec(n), abs(n), sqr(n)
    Attachments
    1.png
    1.png (2.29 KiB)
    Viewed 11412 times
    calcplus.7z (4.71 KiB)
    сорцы + бинарник
    Downloaded 355 times
  • А можно ещё добавить заметную кнопочку "?" с мануалом?
  • From previous post above ;
    " In written or printed mathematics, the expression -3 ^ 2 is interpreted to mean - (3 ^ 2) = -9 "

    Above sentence actually comes directly from Google;
    http://en.wikipedia.org/wiki/Order_of_o ... e_standard
    and Google cites origin for the sentence as a mathematics textbook in the United States ;
    'Elementary Algebra for College Students' .

    ====================
    Wildwest correctly says " Тут могут быть проблемы с написанием формул.
    Например можно написать -1^2 и иметь в виду (-1)^2=-1*-1=1, а не -(1^2) "

    This was previously discussed briefly in CHAT (Sun Apr 20, 2014 2:51 pm);
    chatlogs/chatlog2014-04-20.html and my suggestion was that;
    " 'people MUST input the 'implied' terms {such as implied brackets} when inputting into calc'
    (note implied=understood instinctively)
    "

    e-andrew has made the decision to code such that " -X ^ n == - (x ^ n) "
    (I do not dissent from his coding decision. I agree correct decision.)

    For Wildwest given scenario, I suggest that we should regard it, that it is the
    responsibility of person inputting, to ensure they input according to generally
    accepted conventions of mathematics. If a person mistakely inputs, (not
    according to the convention of mathematics) - to that person falls the blame.
    If they input -1^2 then they will get -1 . {because e-andrew code will regard as -(1^2) ,
    this agrees with the convention of mathematics}.
    { popovpa@
    Logically, it can also be said that -(1^2) , that should be understood as -(1 * 1) ,
    instead of regarding as -1 * -1 . } :)

    Wildwest gives example of another online calcuator which gives wrong answer.
    I found this, http://easycalculation.com/basic-scient ... ulator.php in which it
    will not even allow me to input -(1^2), {using x^y button !!} Therefore, I'm
    a bit impressed because e-andrew program gives correct answer, (Wildwest and myself
    found other some programs give answers wrong or do not even allow input!! :shock: )

    Regarding; " А можно ещё добавить заметную кнопочку "?" с мануалом? "
    мануалом does not need to be fancy affair, can be simple as list of set of
    mathmatical rules that Calc+ follows, {unless SoUrcerer requires otherwise}
    already e-andrew has written it so ;
    -x^n == -(x^n)
    Last edited by buyerninety on Wed Apr 23, 2014 6:46 pm, edited 6 times in total.
  • SoUrcerer wrote:А можно ещё добавить заметную кнопочку "?" с мануалом?
    С мануалом чего? Калькулятора?) Ну вообще да, идея хорошая. Большинство функций будет вынесено в кнопки (куда эти кнопки ставить хз), но некоторые малонужные (вроде inc, dec, str) в кнопках не будут. Скорее всего, реализую с помощью docpack.
  • buyerninety wrote: Wildwest gives example of another online calcuator which gives wrong answer.
    I found this, http://easycalculation.com/basic-scient ... ulator.php in which it
    will not even allow me to input -(1^2), {using x^y button !!} Therefore, I'm
    a bit impressed because e-andrew program gives correct answer, (Wildwest and myself
    found other some programs give answers wrong or do not even allow input!! :shock: )
    These two calculators gives tгue answers, becouse they are not a calcualotors of expressions. They take two arguements and do operation above it.
  • Временно понерфен интерфейс (нужно для будущих апдейтов). Теперь считается по нажатию на Enter. Добавлены две кнопки (клавиатура и помощь), но они пока что не работают.
    Attachments
    CALCPLUS.zip (1.66 KiB)
    Downloaded 350 times
    1.png
    1.png (7.71 KiB)
    Viewed 11300 times
  • Calc+ v0.5
    by e-andrew (совместно с Mister Nikto)
    • Полностью переработан интерфейс.
    • История расчётов. По клику на пункт списка истории ответ копируется в строку ввода. Если выражение не влезает, то оно обрезается и в конец добавляется "...".
    • Добавлен оператор | (модуль). Для тех, кто не помнит, |-6 + 1| = 5.
    • Улучшена клавиатура. Мало того, теперь она по умолчанию скрыта. Чтобы открыть её, нужно нажать на кнопку "Keyboard >" в заголовке.
    • Убран автоматический расчёт. Фича хорошая, но бесполезная.
    • Кнопка "Стереть" вынесена в поле ввода.
    Запускать лучше всего из этого образа.
    Attachments
    calcplus.zip (6.67 KiB)
    Downloaded 339 times
    2.png
    2.png (4.15 KiB)
    Viewed 11238 times
    1.png
    1.png (3 KiB)
    Viewed 11238 times
    Last edited by e-andrew on Wed Jul 09, 2014 8:27 pm, edited 1 time in total.
  • Who is online

    Users browsing this forum: No registered users and 1 guest