Ad
  • Custom User Avatar

    This was an error. It is fixed now, pardon me.

  • Custom User Avatar

    In python, everything is being converted to litre:

    input:  ['62.84941093243942kg', '53.658154513228155l', '35.86201398783972kg', '60.192362035708136g', '27.290504036797568l', '73.41130509717529l', '50.297738338756574g', '41.764827450692465g', '4.5587307453964225lb']
    None should equal ['237.91016014365619l', '203.11757809437387l', '135.75206774956845l', '227.8521672499696l', '103.30547398089351l', '277.8911543148473l', '190.39705870752914l', '158.09657783185125l', '17.256619363623617l']
    
  • Custom User Avatar

    One further issue is that you're using "g" for gallons, but this is the SI symbol for grams. The standard symbol for gallons (both US and Imperial) is "gal".

  • Custom User Avatar

    Thank you for the insight. I am glad you properly understand the kata description.

  • Custom User Avatar

    Alright then.

  • Custom User Avatar

    This makes total sense, but I think it would be worth mentioning then, at least as a hint, that calculations have to be exact and that given ratios are also exact.

  • Custom User Avatar

    You need to be more specific (and less parochial) about units. E.g. your gallons appear to be US gallons, but the most of the world uses imperial gallons. This applies to a number of different measures, mainly of volume. See: https://en.wikipedia.org/wiki/Comparison_of_the_imperial_and_US_customary_measurement_systems. Also "English" is the wrong way to describe US/Imperial units.

  • Custom User Avatar

    Just to follow up on this - my NASM solution was failing because it wasn't handling edge cases with large negative values properly. What threw me was that the same logic was working for a similar solution in C, so I suspect that the C test cases are lacking test cases with large negative values, otherwise some of the existing C solutions would fail. The NASM test cases are good.

  • Custom User Avatar

    Hi - sorry, I think I may have been mistaken - it's probably my code after all.

  • Custom User Avatar

    Could you please give an example of an incorrect test case.

  • Custom User Avatar

    The test cases for NASM seem to be completely wrong