Ad
  • Default User Avatar

    simple absolute value, multiplication and subtraction are not readable? lolz

  • Custom User Avatar

    Search in the youtube. There are several funny things about this one.

  • Default User Avatar

    I have thought for hours about this. On several occasions.
    Can you give me some hint what trick might be hidden there?

  • Default User Avatar

    This is not best practice at all, it's not readable what so ever. This should not be done in a professional environment.

  • Custom User Avatar
  • Custom User Avatar

    7 January 2024 (180 lines)
    This kata is great. I have devoted for this challenge about full 20 days.
    My time is 10644.66ms. I know that it is too much, but .... so many attempts were done during these days.

  • Custom User Avatar

    what if the contents of the list have many elements? like 10 or 20?
    not the best practices.

  • Custom User Avatar
  • Default User Avatar

    its important to prepare for 4th dimensional objects incase physics changes in the future

  • Custom User Avatar
  • Custom User Avatar

    Input for failing test cases is not "+". The error means that at some point, your oslution attempts to parse the string "+" as a number.

    Your solution crashes for following inputs:

    Input expression: 12*-1
    For input string: "+"
    Stack Trace
    java.lang.NumberFormatException: For input string: "+"
    	at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)
    	at java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
    	at java.base/java.lang.Double.parseDouble(Double.java:651)
    	at MathEvaluator.getNumberOnTheRight(MathEvaluator.java:91)
    	at MathEvaluator.calculates(MathEvaluator.java:72)
    	at MathEvaluator.calculate(MathEvaluator.java:30)
    	at TestSuite$MathEvaluatorTest.test(TestSuite.java:57)
      [...]
    
    Input expression: 12* 123/-(-5 + 2)
    For input string: "-"
    Stack Trace
    java.lang.NumberFormatException: For input string: "-"
    	at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)
    	at java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
    	at java.base/java.lang.Double.parseDouble(Double.java:651)
    	at MathEvaluator.getNumberOnTheRight(MathEvaluator.java:91)
    	at MathEvaluator.calculates(MathEvaluator.java:72)
    	at MathEvaluator.calculate(MathEvaluator.java:30)
    	at TestSuite$MathEvaluatorTest.test(TestSuite.java:57)
      [...]
    
    Input expression: (123.45*(678.90 / (-2.5+ 11.5)-(((80 -(19))) *33.25)) / 20) - (123.45*(678.90 / (-2.5+ 11.5)-(((80 -(19))) *33.25)) / 20) + (13 - 2)/ -(-11) 
    For input string: "-"
    Stack Trace
    java.lang.NumberFormatException: For input string: "-"
    	at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)
    	at java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
    	at java.base/java.lang.Double.parseDouble(Double.java:651)
    	at MathEvaluator.getNumberOnTheRight(MathEvaluator.java:91)
    	at MathEvaluator.calculates(MathEvaluator.java:72)
    	at MathEvaluator.calculate(MathEvaluator.java:30)
    	at TestSuite$MathEvaluatorTest.test(TestSuite.java:57)
      [...]
      
    Input expression: 12 * -123
    For input string: "+"
    Stack Trace
    java.lang.NumberFormatException: For input string: "+"
    	at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)
    	at java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
    	at java.base/java.lang.Double.parseDouble(Double.java:651)
    	at MathEvaluator.getNumberOnTheRight(MathEvaluator.java:91)
    	at MathEvaluator.calculates(MathEvaluator.java:72)
    	at MathEvaluator.calculate(MathEvaluator.java:30)
    	at TestSuite$MathEvaluatorTest.test(TestSuite.java:57)
    	[...]
    

    All stacktraces seem to originate from MathEvaluator.getNumberOnTheRight(MathEvaluator.java:91), so you need to search for error in your solution somewhere around there.

  • Default User Avatar

    Hello.

    I use the Java language.

    The tests pass, but when I try to send the code, writes: "For input string:"+"." Then follows Stacktrace, in which: "Java.lang.numberformatexception: for input string:"+". Next, Stacktrace ...".

    My calculator returns 0.0 with a transferred line "+". I don’t understand what needs to be returned to go these tests.

    I think that the exception should be returned to such a line: "+". Since this is not a mathematical expression. I think the decision is the correctness of the exclusion. But I can’t fully understand in which form to return the exception.

    Who can direct to the right thought, please write?

  • Custom User Avatar

    17 August 2023

    Python

    Not hard. Overestimated. It took me three evenings.

  • Custom User Avatar

    11 August 2023. Python. Three weeks. Thinking, drawing and reading.

    1000 - 77.03ms

    All tests 7708.20ms - 9314.85ms

  • Default User Avatar

    As I know, at first, possible errors, non-standard situations are written in the if block.

  • Loading more items...