{"action":"created","issue":{"url":"https://api.github.com/repos/uklimaschewski/EvalEx/issues/32","labels_url":"https://api.github.com/repos/uklimaschewski/EvalEx/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/uklimaschewski/EvalEx/issues/32/comments","events_url":"https://api.github.com/repos/uklimaschewski/EvalEx/issues/32/events","html_url":"https://github.com/uklimaschewski/EvalEx/issues/32","id":93508530,"number":32,"title":"Bug","user":{"login":"sh1nchan","id":8264888,"avatar_url":"https://avatars.githubusercontent.com/u/8264888?v=3","gravatar_id":"","url":"https://api.github.com/users/sh1nchan","html_url":"https://github.com/sh1nchan","followers_url":"https://api.github.com/users/sh1nchan/followers","following_url":"https://api.github.com/users/sh1nchan/following{/other_user}","gists_url":"https://api.github.com/users/sh1nchan/gists{/gist_id}","starred_url":"https://api.github.com/users/sh1nchan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sh1nchan/subscriptions","organizations_url":"https://api.github.com/users/sh1nchan/orgs","repos_url":"https://api.github.com/users/sh1nchan/repos","events_url":"https://api.github.com/users/sh1nchan/events{/privacy}","received_events_url":"https://api.github.com/users/sh1nchan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-07T11:24:07Z","updated_at":"2015-07-07T11:39:29Z","closed_at":"2015-07-07T11:39:29Z","body":"Hallo Udo,\r\n\r\ndie if() Formel hat einen kleinen Bug.\r\nWenn man if (true, -x+y,0) auswerten, möchte, dann kommt es zu einer Fehlermeldung.\r\n"},"comment":{"url":"https://api.github.com/repos/uklimaschewski/EvalEx/issues/comments/119178573","html_url":"https://github.com/uklimaschewski/EvalEx/issues/32#issuecomment-119178573","issue_url":"https://api.github.com/repos/uklimaschewski/EvalEx/issues/32","id":119178573,"user":{"login":"uklimaschewski","id":2771934,"avatar_url":"https://avatars.githubusercontent.com/u/2771934?v=3","gravatar_id":"","url":"https://api.github.com/users/uklimaschewski","html_url":"https://github.com/uklimaschewski","followers_url":"https://api.github.com/users/uklimaschewski/followers","following_url":"https://api.github.com/users/uklimaschewski/following{/other_user}","gists_url":"https://api.github.com/users/uklimaschewski/gists{/gist_id}","starred_url":"https://api.github.com/users/uklimaschewski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uklimaschewski/subscriptions","organizations_url":"https://api.github.com/users/uklimaschewski/orgs","repos_url":"https://api.github.com/users/uklimaschewski/repos","events_url":"https://api.github.com/users/uklimaschewski/events{/privacy}","received_events_url":"https://api.github.com/users/uklimaschewski/received_events","type":"User","site_admin":false},"created_at":"2015-07-07T11:39:29Z","updated_at":"2015-07-07T11:39:29Z","body":"In dem Ausdruck `if(true, -x+y,)` sind zwei Fehler:\r\n1) `true` ist unbekannt, ausser man definiert es als variable mit dem Wert `1`. Sonst kommt es zu einer `NumberFormatException`.\r\n2) \"-x\" ist in der Syntax von EvalEx nicht erlaubt, Prefix und Postfix Operatoren werden nicht unterstützt. Stattdessen `-1*x` verwenden, sonst kommt es zu einem Stack Fehler.\r\n\r\nFolgendes funktioniert dann:\r\n\r\n````Java\r\nExpression expression = new Expression(\"if(true, -1*x+y,0)\");\r\nString result = expression.with(\"true\",\"1\").and(\"x\", \"2\").and(\"y\",\"3\").eval().toPlainString();\r\nassertEquals(\"1\", result);\r\n````\r\n\r\n"}}